Skip to content

Instantly share code, notes, and snippets.

@xeptore
Created July 4, 2021 07:54
Show Gist options
  • Save xeptore/58bdc759889d00b62afe6c055d27fb86 to your computer and use it in GitHub Desktop.
Save xeptore/58bdc759889d00b62afe6c055d27fb86 to your computer and use it in GitHub Desktop.
Nginx Static Files Proxy Pass Configuration
server {
server_name _;
index index.html index.htm index.nginx-debian.html;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://localhost:3000/;
try_files $uri $uri/ @staticfilesproxy;
}
location @staticfilesproxy {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:3000;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment