Welcome! Log In Create A New Profile

Advanced

Re: SSL location keep redirecting to non-SSL

Calin Don
September 03, 2011 05:26AM
You should set a serverwide index directive. You should move index
index.shtml index.php; from location / {} to server {}

Also your rewrite rule rewrite ^(.+) http://www.example.com$1 permanent;
sould be rewritten into rewrite ^ http://www.example.com$request_uri?
permanent;

Take a look at http://wiki.nginx.org/Pitfalls


On Sat, Sep 3, 2011 at 11:17, Ian Evans <ianevans@digitalhit.com> wrote:

> Been scratching my head on this one all night.
>
> Been working on it a bit and now if I go to:
> https://www.example.com/**myfacebookapp/index.shtmlhttps://www.example.com/myfacebookapp/index.shtmlthe page loads but
> https://www.example.com/**myfacebookapphttps://www.example.com/myfacebookappis tossing a 404
>
> I'm really boggled here because the other subdirs are woring and the only
> difference is they're password protected.
>
> Here's the full ssl server conf section:
>
> server {
> server_name www.example.com;
> listen 443;
> root /usr/local/apache/htdocs/;
>
> ssl on;
> ssl_certificate /usr/local/apache/conf/server.**pem;
> ssl_certificate_key /usr/local/apache/conf/server.**key;
> ssl_session_timeout 5m;
> error_page 404 /dhe404.shtml;
>
> location / {
> rewrite ^(.+) http://www.example.com$1 permanent;
>
> index index.shtml index.php;
> }
>
> location ~ \.(shtml|php|inc)$ {
> include /usr/local/nginx/conf/fastcgi-**php.conf;
> fastcgi_pass 127.0.0.1:10004;
> }
>
> location ^~ /myfacebookapp/ {
>
> fastcgi_intercept_errors on;
> include /usr/local/nginx/conf/fastcgi-**php.conf;
> fastcgi_pass 127.0.0.1:10004;
> fastcgi_param HTTPS on;
> }
>
> location ^~ /subdir2/ {
> index index.php;
>
> fastcgi_intercept_errors on;
> include /usr/local/nginx/conf/fastcgi-**php.conf;
> fastcgi_pass 127.0.0.1:10004;
> fastcgi_index index.php;
> fastcgi_param HTTPS on;
> }
>
> location ^~ /subdir3/ {
>
> fastcgi_intercept_errors on;
> include /usr/local/nginx/conf/fastcgi-**php.conf;
> fastcgi_pass 127.0.0.1:10004;
> fastcgi_param HTTPS on;
> auth_basic "example";
> auth_basic_user_file /usr/local/apache/passwd/**passwords;
> }
>
> location /subdir4/ {
> index index.shtml index.php index.html;
> auth_basic "example";
> auth_basic_user_file /usr/local/apache/passwd/**passwords;
> }
>
> location /subdir5/ {
> index index.html;
> auth_basic "example";
> auth_basic_user_file /usr/local/apache/passwd/**passwords;
> }
>
> location ~* ^.+\.(png|gif)$ {
> expires off;
> }
>
> # serve static files directly
> location ~* ^.+.(css|gif|jpe?g|bmp|js|png|**ico)$ {
> expires 30d;
>
> }
>
> }
>
>
> ______________________________**_________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/**mailman/listinfo/nginxhttp://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

SSL location keep redirecting to non-SSL

Ian Evans September 02, 2011 08:52PM

Re: SSL location keep redirecting to non-SSL

Ian Evans September 03, 2011 04:18AM

Re: SSL location keep redirecting to non-SSL

Ian Evans September 03, 2011 05:22AM

Re: SSL location keep redirecting to non-SSL

Calin Don September 03, 2011 05:26AM

Re: SSL location keep redirecting to non-SSL

Ian Evans September 03, 2011 05:36AM

Re: SSL location keep redirecting to non-SSL

Ian Evans September 03, 2011 06:20AM

Re: SSL location keep redirecting to non-SSL

stefancaunter September 03, 2011 06:16AM

Re: SSL location keep redirecting to non-SSL

Ian Evans September 03, 2011 06:26AM

Re: SSL location keep redirecting to non-SSL

Ian Evans September 03, 2011 03:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 151
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready