Skip to content

Instantly share code, notes, and snippets.

@lajunta
Created October 15, 2013 17:25
Show Gist options
  • Save lajunta/6995277 to your computer and use it in GitHub Desktop.
Save lajunta/6995277 to your computer and use it in GitHub Desktop.
upstream festival {
server unix://tmp/festival.sock fail_timeout=0;
}
server {
listen 80;
server_name festival;
root /data/sites/festival/public;
access_log /var/log/nginx/festival_access.log;
error_log /var/log/nginx/festival_error.log;
location /logos/ {
alias /logos/;
# internal;
}
location / {
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Sendfile-Type X-Accel-Redirect;
#proxy_set_header X-Accel-Mapping /logos/=/logopics/; #maps a real path to the internal location
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (-f $request_filename.html) {
rewrite (.*) $1.html break;
}
if (!-f $request_filename) {
proxy_pass http://festival;
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment