Hi,
I mounted quickstarted Turbogears app (named testweb) behind NGINX under prefix testweb configured as folows:
server {
listen 8888;
server_name netcrawler.esabor.intranet;
location /testweb {
proxy_pass http://localhost:9991/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
development.ini looks like:
[DEFAULT]
trace_errors.from_address = turbogears@localhost
trace_errors.smtp_server = localhost
[server:main]
use = egg:gearbox#wsgiref
host = 0.0.0.0
port = 9991
[filter:proxy-prefix]
use = egg:PasteDeploy#prefix
prefix = /testweb
[app:main]
use = egg:testweb
filter_with = proxy-prefix
etc...
When I point browser to
http://netcrawler.esabor.intranet:8888/testweb I am getting TG index page but links are wrong, for instance About points to
http://netcrawler.esabor.intranet:8888/about instead of
http://netcrawler.esabor.intranet:8888/testweb/about (all the links are missing testweb part).
When I try to log in manualy entering
http://netcrawler.esabor.intranet:8888/testweb/login I can enter username and password but get redirected to
http://netcrawler.esabor.intranet:8888/login_handler?__logins=0&came_from=%2F (again without testweb part)
If I log in from different browser tab to gearbox instance
http://netcrawler.esabor.intranet:9991/login and complete log in process I can reach
http://netcrawler.esabor.intranet:8888/testweb/adminand links on that page are OK.
Am I doing something wrong or need to additionaly configure something (or something is wrong with tg.url)?
Steps to replicate:
virtualenv dir
cd dir
source bin/activate
pip install tg.devtools
gearbox quickstart testweb
cd testweb
python setup.py install
edit development.ini as above
edit nginx config file as above
restart nginx
gearbox setup-app
gearbox serve
With Best Regards
Ervin