Created
December 4, 2021 10:04
-
-
Save codebubb/40d6972934074b9e8f65b4930d0ae379 to your computer and use it in GitHub Desktop.
nginx Example Server Config
This file contains 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
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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From the video at https://youtu.be/A0pb8Aa9L7M