Skip to content

Instantly share code, notes, and snippets.

@hobodave
Created May 22, 2013 18:38
Show Gist options
  • Select an option

  • Save hobodave/5629859 to your computer and use it in GitHub Desktop.

Select an option

Save hobodave/5629859 to your computer and use it in GitHub Desktop.
server {
listen *:80;
server_name www.example.com;
# Sets the host, even if proxying
set $safehost $http_host;
if ($http_x_forwarded_host != '') {
set $safehost $http_x_forwarded_host;
}
location = /lovelocal/instagram-subscribe.php {
include /usr/local/etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTP_HOST $safehost;
fastcgi_param SERVER_NAME $safehost;
fastcgi_pass 127.0.0.1:9000;
}
location ~ ^/(.+) {
rewrite ^ https://www.example.com$request_uri permanent;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment