Created
June 26, 2018 02:02
-
-
Save Jamp/11425424274fce7574645cd37dd1f6a8 to your computer and use it in GitHub Desktop.
Configuración para Nginx + Webapp + API Express + SocketIO
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
upstream spa { | |
server webapp:2000; | |
} | |
upstream api { | |
server api:3000; | |
} | |
server { | |
listen 80 default_server; | |
server_name _; | |
root /var/html/www; | |
location / { | |
include /etc/nginx/proxy_reverse.conf; | |
proxy_pass http://spa/; | |
} | |
location /api/ { | |
include /etc/nginx/proxy_reverse.conf; | |
proxy_pass http://api/; | |
} | |
location /socket.io/ { | |
include /etc/nginx/websocket.conf; | |
proxy_pass http://api/socket.io/; | |
} | |
} |
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
proxy_redirect off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Host $server_name; |
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
proxy_http_version 1.1; | |
proxy_buffering off; | |
proxy_redirect off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
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