https causes site to be in text

83 views
Skip to first unread message

peter

unread,
Nov 29, 2016, 10:47:37 AM11/29/16
to 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

unread,
Nov 29, 2016, 10:55:13 AM11/29/16
to web2py-users
Try look in link reference css files.. put https maybe..

Leonel Câmara

unread,
Nov 29, 2016, 12:05:35 PM11/29/16
to web2py-users
You are missing a bunch of files


All those got a 404

peter

unread,
Nov 29, 2016, 12:26:56 PM11/29/16
to web2py-users
Thanks Leonel
I am not missing the http equivalents, so where is routing different for https to http in web2py?

Peter

peter

unread,
Nov 29, 2016, 12:35:10 PM11/29/16
to 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

unread,
Dec 1, 2016, 3:23:26 AM12/1/16
to web2py-users
I see you're using nginx ... can you show us some of the config?

/dps

Dave S

unread,
Dec 1, 2016, 3:23:58 AM12/1/16
to web2py-users
The http version indicates you have a nice-looking site, BTW.
 
/dps

peter hutchinson

unread,
Dec 1, 2016, 1:40:59 PM12/1/16
to 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

unread,
Dec 1, 2016, 5:32:30 PM12/1/16
to 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

unread,
Dec 5, 2016, 10:24:37 AM12/5/16
to 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

unread,
Dec 5, 2016, 2:16:24 PM12/5/16
to web2py-users, pe...@somuch.info
I like stories with a happy ending.

/dps
 
Reply all
Reply to author
Forward
0 new messages