Created
August 31, 2018 10:30
-
-
Save danielkhoo/38b51a36ac4cc6f321a3c77d27aa5516 to your computer and use it in GitHub Desktop.
Nginx Proxy for Node
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 characters
server_name mynewsite.com www.mynewsite.com; | |
location / { | |
#----------Add this section----------- | |
proxy_set_header Host $http_host; | |
proxy_set_header X-NginX-Proxy true; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_pass http://127.0.0.1:3000; | |
proxy_redirect off; | |
#----------Add this section----------- | |
# First attempt to serve request as file, then | |
# as directory, then fall back to displaying a 404. | |
try_files $uri $uri/ =404; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment