server { listen 80; server_name localhost; #charset koi8-r; #access_log /var/log/nginx/host.access.log main; location /jsonrpc { rewrite /jsonrpc/?(.*) /$1 break; proxy_pass http://rpcnode:8545; proxy_redirect off; proxy_set_header Host $host; } location /jsonws { rewrite /jsonws/?(.*) /$1 break; proxy_pass http://rpcnode:8546; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; } location / { root /usr/share/nginx/html; try_files $uri /index.html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }