Can't login after enable HTTPS

iphonecake5688

New Member
YetiShare User
Jan 26, 2016
5
0
0
Hi guys

I used to use yetishare with non-SSL servers, recently I decided to upgrade to support HTTPS

but after I enabled https, every time when I try to login, I got this:
Any help would be much appreciated! BTW I did not use CloudFlare

 

adam

Administrator
Staff member
Dec 5, 2009
2,043
108
63
Check you have all the Nginx rules correctly set. This is normally the cause.
 

iphonecake5688

New Member
YetiShare User
Jan 26, 2016
5
0
0
adam said:
Check you have all the Nginx rules correctly set. This is normally the cause.
Thanks for your reply, I added all the rules listed in the sample file, still getting this error, following is my config file, please let me know if you see anything wrong

Code:
server {
listen 80;
server_name mysite.com www.mysite.com;
rewrite ^ https://www.mysite.com$request_uri? permanent;
}

server
    {
        listen 443;
        server_name www.mysite.com;
        index index.html index.htm index.php;
        root  /wwwroot/mysite.com;

        #error_page   404   /404.html;
        include enable-php.conf;

 ssl on;
 ssl_certificate /ssl/ssl.crt;
 ssl_certificate_key /ssl/ssl.key;
 ssl_protocols TLSv1 TLSv1.1 TLSv1.2;


		location /files {
		    root /wwwroot/mysite.com;
		    internal;
		} 

        location /nginx_status
        {
            stub_status on;
            access_log   off;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /\.
        {
            deny all;
        }
        access_log  /wwwlogs/mysite.com.log  access;
        
        
	#YetiShare rules
    location ~ \.php$ {
        if (!-e $request_filename) { rewrite ^/(.*) /index.php?_page_url=$1 last; }
    }

    location / {
		if (!-e $request_filename) {
			rewrite ^/(.*) /index.php?_page_url=$1 last;
		}
    }

    location /files/ {
        internal;
    }

    # these locations would be hidden by .htaccess normally
    location /core/logs/ {
        deny all;
    }



    }
 

adam

Administrator
Staff member
Dec 5, 2009
2,043
108
63
Hi,

This section is different to the rules we supply:

location ~ \.php$ {
if (!-e $request_filename) { rewrite ^/(.*) /index.php?_page_url=$1 last; }
}

Also remove anything else which isn't part of the rules we provide, at least to get it working.

Adam.
 

iphonecake5688

New Member
YetiShare User
Jan 26, 2016
5
0
0
adam said:
Hi,

This section is different to the rules we supply:

location ~ \.php$ {
if (!-e $request_filename) { rewrite ^/(.*) /index.php?_page_url=$1 last; }
}

Also remove anything else which isn't part of the rules we provide, at least to get it working.

Adam.

I have removed all other rules. This is how my config file looks like now, still not working:

Code:
server {
listen 80;
server_name mysite.com www.mysite.com;
rewrite ^ https://www.mysite.com$request_uri? permanent;
}

server
    {
        listen 443;
        server_name www.mysite.com;
        index index.html index.htm index.php;
        root  /wwwroot/mysite.com;

        #error_page   404   /404.html;
        include enable-php.conf;

 ssl on;
 ssl_certificate /ssl/ssl.crt;
 ssl_certificate_key /ssl/ssl.key;
 ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        
        
   #YetiShare rules
    location ~ \.php$ {
        if (!-e $request_filename) { rewrite ^/(.*) /index.php?_page_url=$1 last; }
    }

    location / {
      if (!-e $request_filename) {
         rewrite ^/(.*) /index.php?_page_url=$1 last;
      }
    }

    location /files/ {
        internal;
    }

    # these locations would be hidden by .htaccess normally
    location /core/logs/ {
        deny all;
    }



    }
 

adam

Administrator
Staff member
Dec 5, 2009
2,043
108
63
You still have things in there which aren't in the rules we supply. For example, I don't know what this file does:

include enable-php.conf;

This section is missing some rules, but I'm not sure if your setup needs it. It's not matching our rules though.

location ~ \.php$ {
if (!-e $request_filename) { rewrite ^/(.*) /index.php?_page_url=$1 last; }
}
 

iphonecake5688

New Member
YetiShare User
Jan 26, 2016
5
0
0
thanks for your help, the other config file has duplicate settings for the .php files.

it's fixed now.

it's strange the same config would work on non-SSL site...