Skip to content

Instantly share code, notes, and snippets.

@codebubb
Created December 4, 2021 10:04
Show Gist options
  • Save codebubb/40d6972934074b9e8f65b4930d0ae379 to your computer and use it in GitHub Desktop.
Save codebubb/40d6972934074b9e8f65b4930d0ae379 to your computer and use it in GitHub Desktop.
nginx Example Server Config
server {
listen 80;
listen [::]:80;
root /var/www/{domain}/html;
index index.html index.htm index.nginx-debian.html;
server_name {domain} www.{domain};
location /api/ {
proxy_pass http://localhost:{node_port}/;
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;
proxy_set_header X-Forwarded-For $remote_addr;
}
location / {
try_files $uri $uri/ =404;
}
}
@codebubb
Copy link
Author

codebubb commented Dec 5, 2021

From the video at https://youtu.be/A0pb8Aa9L7M

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment