Skip to content

Instantly share code, notes, and snippets.

@kurokikaze
Created January 18, 2010 16:13
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurokikaze/9b793ef2831ad66f6958 to your computer and use it in GitHub Desktop.
Save kurokikaze/9b793ef2831ad66f6958 to your computer and use it in GitHub Desktop.
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