-
-
Save kurokikaze/9b793ef2831ad66f6958 to your computer and use it in GitHub Desktop.
nginx config for frowarding requests to Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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