SSL location keep redirecting to non-SSL

Ian Evans ianevans at
Sat Sep 3 00:51:11 UTC 2011 brain's been hurting on this one tonight.

My site's been running fine on nginx for years. have SSL and non-SSL 
locations. PHP runs through .shtml files

Working on a Facebook app and right now need to have it work with both 
the SSL and non-SSL URL. Testing the coding on my server right now.

If I go to the page loads.
If I go to the page 
loads. <-note https
If I go to the page redirects to <-note https on first URL

Here are the relevant locations in the SSL server section:

location / {
root /usr/local/apache/htdocs;
rewrite ^(.+)$1 permanent;
index index.shtml index.php;
location ~ \.(shtml|php|inc)$ {
root /usr/local/apache/htdocs;
include /usr/local/nginx/conf/fastcgi-php.conf;

location ^~ /myappsname/ {
index index.shtml
root /usr/local/apache/htdocs/;
fastcgi_intercept_errors on;
include /usr/local/nginx/conf/fastcgi-php.conf;
fastcgi_param HTTPS on;

I'll probably smack my head when this is pointed out to me. All my other 
SSL locations work fine. Any idea why including the filename stays SSL 
but dropping it redirects?


More information about the nginx mailing list