Skip to content

Instantly share code, notes, and snippets.

@qianduan
Created December 13, 2013 03:38
Show Gist options
  • Save qianduan/7939466 to your computer and use it in GitHub Desktop.
Save qianduan/7939466 to your computer and use it in GitHub Desktop.
nginx reverse proxy for node.js
log_format snake.isux.us '$remote_addr - $remote_user [$time_local] $request'
'$status $body_bytes_sent $http_referer'
'$http_user_agent $http_x_forwarded_for';
upstream snake.isux.us{
server 127.0.0.1:3000;
}
server {
listen 80;
server_name snake.isux.us;
root /home/www/snake/;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://snake.isux.us;
proxy_redirect off;
}
access_log /home/wwwlogs/snake.isux.log snake.isux.us;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment