Skip to content

Instantly share code, notes, and snippets.

@gsf
Created June 9, 2015 05:21
Show Gist options
  • Save gsf/15b639266fc562571735 to your computer and use it in GitHub Desktop.
Save gsf/15b639266fc562571735 to your computer and use it in GitHub Desktop.
server {
if ($http_x_forwarded_proto = http) {
return 301 https://$host$request_uri;
}
add_header Strict-Transport-Security "max-age=31536000";
set $cache_uri $uri;
# Needed for some admin sections
if ($request_method = POST) {
set $cache_uri 'null cache';
}
set $app_root /srv/www/philagov/current;
root $app_root;
index index.php;
location / {
try_files /wp-content/cache/supercache/$host${cache_uri}index-https.html /wp$uri $uri /wp/index.php;
}
location /wp-admin/ {
root $app_root/wp;
}
location ~ \.php$ {
try_files $uri /wp$uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
include wordpress_fastcgi_params;
}
location /property/ {
proxy_pass https://cityofphiladelphia.github.io/property2/;
proxy_set_header Host cityofphiladelphia.github.io;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment