Skip to content

Instantly share code, notes, and snippets.

@icecreammatt
Created April 13, 2014 06:11
Show Gist options
  • Save icecreammatt/10571312 to your computer and use it in GitHub Desktop.
Save icecreammatt/10571312 to your computer and use it in GitHub Desktop.
nginx config
upstream localhost {
server 127.0.0.1:50000;
}
server {
#listen 80 default_server;
listen 0.0.0.0:80;
listen [::]:80 default_server ipv6only=on;
#root /usr/share/nginx/html;
#index index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
access_log /var/log/nginx/test.log;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ /index.html;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
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://localhost/;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /doc/ {
alias /usr/share/doc/;
autoindex on;
allow 127.0.0.1;
allow ::1;
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment