Forked from wernersmit/plesk-nginx-extra-reverse-proxy.conf
Created
September 23, 2020 18:56
Revisions
-
wernersmit created this gist
Mar 7, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ ## If someone enters two slashes, '//' combine them into one merge_slashes on; ## Make sure everything is forwarded to https:// if ($scheme = http) { return 301 http://$server_name$request_uri; } ## Remove trailing slashes rewrite ^/(.*)/$ /$1 permanent; ## If the index.html (can be anything) is looked for, redirect to / ## Fix for Plesk location /{} forcing index.html to be loaded rewrite ^(.+)/index.html$ $1 permanent; location = /index.html { internal; error_page 404 =301 $scheme://domain.com/; } ## If the location is equal to / location = / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://127.0.0.1:3000; } ## Proxy pass everything else to node as well location ~ / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://127.0.0.1:3000; }