Skip to content

Instantly share code, notes, and snippets.

@sneeu
Created December 1, 2011 11:42
Show Gist options
  • Save sneeu/1416104 to your computer and use it in GitHub Desktop.
Save sneeu/1416104 to your computer and use it in GitHub Desktop.
server {
listen 80 default;
access_log /var/www/sagan/logs/nginx.access.log;
error_log /var/www/sagan/logs/nginx.error.log;
location / {
root /var/www/sagan/static/;
try_files $uri $uri/index.html @proxy;
}
location @proxy {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8000;
}
location /media {
alias /var/www/sagan/media;
}
location /google2e84deffb90c47c8.html {
alias /var/www/sagan/static/google2e84deffb90c47c8.html;
}
}
@lenary
Copy link

lenary commented Dec 1, 2011

is it the fact that you've used location = / {...} rather than just location / {...} ? (Cursory glance only. not delved too far into nginx, so I am probably wrong)

@pyrat
Copy link

pyrat commented Dec 1, 2011

@sneeu
Copy link
Author

sneeu commented Dec 1, 2011

Found the solution to creating a static home-page at / in the Nginx forum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment