Skip to content

Instantly share code, notes, and snippets.

@cookie-ag
Last active October 4, 2016 05:18
Show Gist options
  • Save cookie-ag/3233524b6209d2e9ab6084b61b2880e4 to your computer and use it in GitHub Desktop.
Save cookie-ag/3233524b6209d2e9ab6084b61b2880e4 to your computer and use it in GitHub Desktop.
Nginx config for Ubuntu 16.04
// /etc/nginx/sites-available/default
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /app2 { //Add only if want to add another application running on port 8081
proxy_pass http://localhost:8081;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment