Skip to content

Instantly share code, notes, and snippets.

@lirantal
Created November 27, 2016 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lirantal/a0b5189049ffc2349ed3816c0cdf4607 to your computer and use it in GitHub Desktop.
Save lirantal/a0b5189049ffc2349ed3816c0cdf4607 to your computer and use it in GitHub Desktop.
Nginx Proxy Pass for API/Frontend servers
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