EVM Endpoint

server {
    listen 80;
    server_name evm-endpoint.provewithryd.xyz; # change with your grpc domain
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    server_name evm-endpoint.provewithryd.xyz; # change with your grpc domain

    # change provewithryd.xyz with your ssl path
    ssl_certificate /etc/letsencrypt/live/provewithryd.xyz/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/provewithryd.xyz/privkey.pem;

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;

    add_header 'Access-Control-Allow-Origin' '*' always;
    add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
    add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization' always;

    if ($request_method = OPTIONS) {
        add_header 'Content-Length' 0;
        add_header 'Content-Type' 'text/plain; charset=UTF-8';
        return 204;
    }

    location / {
        proxy_pass http://127.0.0.1:8545;  # change with your evm port
        proxy_http_version 1.1;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Last updated