#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { rewrite __PATH__/(.*) /$1 break; rewrite ^__PATH__$ __PATH__/ permanent; proxy_redirect / __PATH__/; proxy_pass http://127.0.0.1:__PORT__; proxy_buffering off; # be careful, this line doesn't override any proxy_buffering on set in a conf.d/file.conf proxy_set_header Host $host; proxy_pass_header Server; } location __PATH__/socket.io { rewrite __PATH__/socket.io/(.*) /socket.io/$1 break; proxy_redirect / __PATH__/; proxy_pass http://127.0.0.1:__PORT__; proxy_buffering off; # be careful, this line doesn't override any proxy_buffering on set in a conf.d/file.conf proxy_set_header Host $host; proxy_pass_header Server; } location __PATH__/static { rewrite __PATH__/static/(.*) /static/$1 break; proxy_pass http://127.0.0.1:__PORT__; proxy_buffering off; # be careful, this line doesn't override any proxy_buffering on set in a conf.d/file.conf proxy_set_header Host $host; proxy_pass_header Server; }