Skip to content

Instantly share code, notes, and snippets.

@lukaszewczak
Created May 21, 2019 03:27
Show Gist options
  • Save lukaszewczak/039999a0f9b31cbeebba29704cbc4fb7 to your computer and use it in GitHub Desktop.
Save lukaszewczak/039999a0f9b31cbeebba29704cbc4fb7 to your computer and use it in GitHub Desktop.
upstream api_node_js {
server 127.0.0.1:4000;
}
server {
listen 80;
listen [::]:80;
root /var/www/webapp/dist;
index index.html;
access_log /var/log/nginx/webapp.access.log;
error_log /var/log/nginx/webapp.error.log;
location / {
try_files $uri $uri/ =404;
}
location /auth/ {
proxy_pass http://api_node_js;
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 /api/ {
proxy_pass http://api_node_js;
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