Create a gist now

Instantly share code, notes, and snippets.

@kurokikaze /nginx.conf Secret
Created Jan 18, 2010

What would you like to do?
nginx config for frowarding requests to Node.js
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
server {
listen 192.168.175.128:80; # IP, который мы будем слушать
location / {
proxy_pass http://192.168.175.128:8000; # IP и порт, на которых висит node.js
proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarder_for;
}
location ^~ /files/ {
root /home/www; # Путь к корневому каталогу со статическими файлами
}
}
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment