python - Debugging Apache/Django/WSGI Bad Request (400) Error then aliasing sub-path -
i have django projet running on domain example.com juste fine. want alias 1 particular app example2.com but, when disable django debug, keep getting bad request (400) error.
i use django 1.7.7 python 2.7.9 on debian jessie. example.com , example2.com both served apache 2.4.10 wsgi module 4.3.0.
in apache global scope configuration have :
wsgidaemonprocess tracking user=www-data group=www-data processes=2 threads=15 python-path=/path/to/projects/tracking/ display-name=wsgi-django-tracking
in example.com vhost have:
wsgiscriptalias / /path/to/projects/tracking/tracking/wsgi.py wsgiprocessgroup tracking <directory /path/to/projects/tracking/tracking/> <files wsgi.py> require granted </files> </directory>
in example2.com vhost have (note /myapp on @ end of both paramater of wsgiscriptalias instruction):
wsgiscriptalias /myapp /path/to/projects/tracking/tracking/wsgi.py/myapp wsgiprocessgroup tracking <directory /path/to/projects/tracking/tracking/> <files wsgi.py> require granted </files> </directory>
in django settings have:
allowed_hosts = ["example.com", "example2.com"]
with debug=true
works great. when set debug=false
, example.com keep working when try access http://example2.com/myapp :
bad request (400)
nothing usefull shows in /var/log/apache2/error.log
nor /var/log/apache2/access.log
i'am little confused.
thank help.
double-check hostname present in allowed_hosts
entry. know said is, 400 bad request
error you'd if hostname missing setting.
please check allowed_hosts
again.
Comments
Post a Comment