/etc/nginx/sites-available/web2py
server {
listen 80;
server_name $hostname;
###to enable correct use of response.static_version
#location ~* /(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$ {
# alias /home/www-data/web2py/applications/$1/static/$2;
# expires max;
#}
###
###if you use something like myapp = dict(languages=[en, it, jp], default_language=en) in your routes.py
#location ~* /(\w+)/(en|it|jp)/static/(.*)$ {
# alias /home/www-data/web2py/applications/$1/;
# try_files static/$2/$3 static/$3 =404;
#}
###
location ~* /(\w+)/static/ {
#root /home/www-data/web2py/applications/;
root /home/user1/Vhome/Vweb2py/web2py/applications/;
#remove next comment on production
#expires max;
### if you want to use pre-gzipped static files (recommended)
### check scripts/zip_static_files.py and remove the comments
# include /etc/nginx/conf.d/web2py/gzip_static.conf;
###
}
location /user1
{
#uwsgi_pass 127.0.0.1:9001;
uwsgi_pass unix:///tmp/web2py.socket;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
###remove the comments to turn on if you want gzip compression of your pages
# include /etc/nginx/conf.d/web2py/gzip.conf;
### end gzip section
### remove the comments if you use uploads (max 10 MB)
#client_max_body_size 10m;
###
uwsgi_param SCRIPT_NAME /user1
;
uwsgi_modifier1 30;
}
}
server {
listen 443 default_server ssl;
server_name $hostname;
ssl_certificate /etc/nginx/ssl/web2py.crt;
ssl_certificate_key /etc/nginx/ssl/web2py.key;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_ciphers ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA;
ssl_protocols SSLv3 TLSv1;
keepalive_timeout 70;
location / {
#uwsgi_pass 127.0.0.1:9001;
uwsgi_pass unix:///tmp/web2py.socket;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
###remove the comments to turn on if you want gzip compression of your pages
# include /etc/nginx/conf.d/web2py/gzip.conf;
### end gzip section
### remove the comments if you want to enable uploads (max 10 MB)
#client_max_body_size 10m;
###
}
## if you serve static files through https, copy here the section
## from the previous server instance to manage static files
}
# -*- coding: utf-8 -*-
# default_application, default_controller, default_function
# are used when the respective element is missing from the
# (possibly rewritten) incoming URL
#
default_application = 'init' # ordinarily set in base routes.py
default_controller = 'default' # ordinarily set in app-specific routes.py
default_function = 'index' # ordinarily set in app-specific routes.py
BASE = 'user1'
routers = dict(
BASE = dict(
domains = {
'jeraweb1.bc': 'aut',
'jeraweb1.bc/user1/welcome': 'welcome',
'jeraweb1.bc/user1/aut': 'aut',
'jeraweb1.bc/user1/aut2': 'aut2',
}
),
)
and routes.py
# -*- coding: utf-8 -*-
# default_application, default_controller, default_function
# are used when the respective element is missing from the
# (possibly rewritten) incoming URL
#
default_application = 'init' # ordinarily set in base routes.py
default_controller = 'default' # ordinarily set in app-specific routes.py
default_function = 'index' # ordinarily set in app-specific routes.py
BASE = 'user1'
routers = dict(
BASE = dict(
domains = {
'jeraweb1.bc': 'aut',
'jeraweb1.bc/user1/welcome': 'welcome',
'jeraweb1.bc/user1/aut': 'aut',
'jeraweb1.bc/user1/aut2': 'aut2',
}
),
)
but that don't work.
Any idea?
Thanks can you give my an example ?
Thanks can you give my an example ?
--
---
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/ybpY_llWT5s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
thanks you.I mean an example of the pattern-based router.Before I leave my office, I have try tu use the pattern-based router.And i don't find the solution, for example when i request the url mydomain/user1/myApp that work but when I click on homeHome point to mydomain/user1/myApp/user1/myApp.I give an other try and home point to mydomain/myAppSo i think the routes_in is correct but the routes_out is incorrectI am @home now.