1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
upstream myserver { # 기본 round robin server localhost:3000; server localhost:3001; } server { listen 8080; listen [::]:8080; # server_name xxx.anyons.net; root /nodejsPath; location / { allow 192.168.1.0/24; deny all; # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. # try_files $uri $uri/ =404; try_files $uri @myserver; } location @myserver { proxy_redirect off; proxy_http_version 1.1; proxy_pass http://myserver; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_set_header X-NginX-Proxy true; # proxy_redirect http://myserver http://$server_name; } } |