https causes site to be in text

已查看 83 次
跳至第一个未读帖子

peter

未读,
2016年11月29日 10:47:372016/11/29
收件人 web2py-users
I have a site written in web2py, spinjazz.net. It works fine. I have bought an ssl certificate for the site, which works. However when I access the site via https, it appears as a text only site. I am sure there is a simple explanation for this, but I do not know what it is.

Any ideas?

Thanks

Peter

Marlysson Silva

未读,
2016年11月29日 10:55:132016/11/29
收件人 web2py-users
Try look in link reference css files.. put https maybe..

Leonel Câmara

未读,
2016年11月29日 12:05:352016/11/29
收件人 web2py-users
You are missing a bunch of files


All those got a 404

peter

未读,
2016年11月29日 12:26:562016/11/29
收件人 web2py-users
Thanks Leonel
I am not missing the http equivalents, so where is routing different for https to http in web2py?

Peter

peter

未读,
2016年11月29日 12:35:102016/11/29
收件人 web2py-users
In my routes.py I have

routes_in = ((r'.*://spinjazz.net:\w* /static/$anything', r'/new_spin2/static/$anything'),

presumably this is routing only http correctly can anyone tell me how I can get it to work for https

Thanks
Peter

Dave S

未读,
2016年12月1日 03:23:262016/12/1
收件人 web2py-users
I see you're using nginx ... can you show us some of the config?

/dps

Dave S

未读,
2016年12月1日 03:23:582016/12/1
收件人 web2py-users
The http version indicates you have a nice-looking site, BTW.
 
/dps

peter hutchinson

未读,
2016年12月1日 13:40:592016/12/1
收件人 web...@googlegroups.com
In my nginx.conf I have 

.........

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  explorejazz.com;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location ~* /(\w+)/static/ {
            root /opt/web2py_apps/web2py/applications/;
        }

        location / {
            include uwsgi_params;
            uwsgi_pass unix:/run/uwsgi/web2py.sock;
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
    
    server {
        listen 443;
        server_name explorejazz.com;
        
        ssl on;
        ssl_certificate /etc/nginx/ssl/web2py.crt;
        ssl_certificate_key /etc/nginx/ssl/web2py.key;
        
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
        ssl_prefer_server_ciphers on;
        
        location / {
            include uwsgi_params;
            uwsgi_pass unix:/run/uwsgi/web2py.sock;
        }
    }

Maybe I should copy the 
        location ~* /(\w+)/static/ {
            root /opt/web2py_apps/web2py/applications/;
        }
bit to  the listen 443 section?

This looks like it is routing directly to the static folde, and so appears like it could cause the difference between the http and https behaviour.

Peter

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/zQRFXsmMD5A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian M

未读,
2016年12月1日 17:32:302016/12/1
收件人 web2py-users、pe...@somuch.info
The web server block for https probably needs all the same locations and error pages and such as the http server block has for the site to act the same. If those rules created identify the locations of items for the web server allow it to work in http, it only makes sense that the same rules should be needed in the https server.

The only difference should probably be that extra stuff for ssl certs, and port numbers obviously. 

There is one line that includes files:
include /etc/nginx/default.d/*.conf;

I use apache so I am only guessing, but you will want to examine the files to be sure if you include them on the https that nothing in there will botch up the ssl you are shooting for. You probably need a good reference to troubleshoot this thing by changing one line at  a time and seeing if that fixed it. Then referring to the docs for help on what the items mean. The link below looks like it might be what I would start out reading if I was undertaking such a task.


That being said, the first thing I'd try is to copy all that stuff in and see what happens after a quick glance at the *.conf files. And then like Leonel did, try loading each resource one at a time to see if they all work. At least one of each type in each folder and so on, just to be sure. 

Good Luck,
Brian
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.

peter

未读,
2016年12月5日 10:24:372016/12/5
收件人 web2py-users、pe...@somuch.info
I was pretty stumped as to how to go about solving the problem, so the support I got was great.

Putting

        location ~* /(\w+)/static/ {
            root /opt/web2py_apps/web2py/applications/;
        }


in the 'listen 443' just as it is in the 'listen 80' section did indeed solve the problem. I will suggest that the script for nginx and uswgi on centos 7 is updated.

Thanks for your positive feedback Dave S.

Thanks for you help everyone.

Peter

Dave S

未读,
2016年12月5日 14:16:242016/12/5
收件人 web2py-users、pe...@somuch.info
I like stories with a happy ending.

/dps
 
回复全部
回复作者
转发
0 个新帖子