Web2py routes domains do not work for me anymore

32 views
Skip to first unread message

Anatoli Hristov

unread,
Apr 15, 2020, 7:05:48 PM4/15/20
to web2py-users
Hello,

I used to use the routes.py in the root of web2py folder where after deployed a new server, and restored the web apps, it shows (Internal server error):

This is my routes.py 

routers = dict(
    BASE  = dict(
        domains = {
            'mydomain.com' : 'myapp',
        }
    ),
)


Thank you helping me out -_-

Dave S

unread,
Apr 15, 2020, 7:09:17 PM4/15/20
to web2py-users
Is there a ticket generated?  Probably in myapp/errors ...
Otherwise, what is in the web2py.log or your front-end logs?

BTW, Google Groups doesn't make it clear, but the "show on top" setting for a post should be reserved for posts that relate to policies and resources, like Massimo's note about the new py4web group.

/dps
 

Anatoli Hristov

unread,
Apr 15, 2020, 7:13:50 PM4/15/20
to web2py-users
Thank you Dave,

There are no error logs from this :( It just keep showing internal server error until I delete the routes,py from the root folder.

Sorry for topping up the post, I cannot remove it anymore, shall I delete the post?

Thanks

Anatoli Hristov

unread,
Apr 15, 2020, 7:20:18 PM4/15/20
to web2py-users
Found some log in nginx access.log:

10.63.238.14 - - [15/Apr/2020:23:18:00 +0000] "GET / HTTP/1.0" 500 21 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
10.63.238.14 - - [15/Apr/2020:23:18:01 +0000] "GET /favicon.ico HTTP/1.0" 500 21 "https://my.domain.xyz/" "Mozilla/5.0  AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"

Dave S

unread,
Apr 15, 2020, 7:38:28 PM4/15/20
to web2py-users


On Wednesday, April 15, 2020 at 4:20:18 PM UTC-7, Anatoli Hristov wrote:
Found some log in nginx access.log:

10.63.238.14 - - [15/Apr/2020:23:18:00 +0000] "GET / HTTP/1.0" 500 21 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
10.63.238.14 - - [15/Apr/2020:23:18:01 +0000] "GET /favicon.ico HTTP/1.0" 500 21 "https://my.domain.xyz/" "Mozilla/5.0  AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"

Your ".xyz" matches what is in the routes.py?

If you're not having nginx short cut to the static files (favicon.ico, in this case), then I would turn on web2py logging and see if the web2py.log has anything  

Taking a quick look at my routes.py, I don't set domains, just the default application, but I do add
root_static = ['favicon.ico', 'robots.txt']


Don't know if that will help, but then I'm not a routes.py power user.

/dps

Anatoli Hristov

unread,
Apr 15, 2020, 8:31:48 PM4/15/20
to web2py-users
nothing in the web2py log file, file not even created!

I don't know how to define the favico.ico in nginx. 
However, if I delete the routes.py everything works, but I need to define domains for my apps!

Dave S

unread,
Apr 16, 2020, 5:18:54 PM4/16/20
to web2py-users


On Wednesday, April 15, 2020 at 5:31:48 PM UTC-7, Anatoli Hristov wrote:
nothing in the web2py log file, file not even created!


Have you set up the logging controls?  There's logging.conf in the web2py folder.  My quick search doesn't show where in the book this is described, but the sample logging.conf in the distribution should help.



 
I don't know how to define the favico.ico in nginx. 
However, if I delete the routes.py everything works, but I need to define domains for my apps!


That would be using a URL match and the try_files verb .   I do the root_static in routes.py for my /favico.ico. but I use try_files to dump a word list on some GETs for funny URLs (outsiders probing the site for leaks).

/dps
Reply all
Reply to author
Forward
0 new messages