Created
November 27, 2016 10:10
-
-
Save lirantal/a0b5189049ffc2349ed3816c0cdf4607 to your computer and use it in GitHub Desktop.
Nginx Proxy Pass for API/Frontend servers
This file contains 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
nginx config: `/etc/nginx/sites-enabled/default` | |
``` | |
server { | |
location / { | |
proxy_pass http://localhost:3000; | |
} | |
location /api { | |
proxy_pass http://localhost:8080; | |
} | |
# Handle WebSockets. | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment