Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Nginx Settings for NodeJS App
# Nginx Reverse Proxy for NodeJS Apps
listen 80;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/;
include none.conf;
if ($http_host != "") {
rewrite ^$request_uri permanent;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
location ~* \.(?:ico|css|js|gif|jpe?g|png|ttf|woff)$ {
add_header Pragma public;
add_header Cache-Control "public, mustrevalidate, proxy-revalidate";
location ~ .*\.(php|php5)?$
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
expires 30d;
location ~ .*\.(js|css)?$
expires 12h;
access_log off;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.