Hi,

I've worked on a django project, which works fine when running with the debug server, but behaves strangely with Cherokee and uWSGI.

With the debug server I can successfully fetch my app's login page using the following URLs:

  localhost:8000/app
  localhost:8000/app/
  localhost:8000/app/login

However, when I deploy to Cherokee + uWSGI, the equivalent URLs produce 404s:

  example.com/app
  example.com/app/
  example.com/app/login

After some testing, I found that the following URLs could successfully retrieve my app's login page:

  example.com/app/app/
  example.com/app/app/login

Although example.com/app/app still produces a 404.

I have the following in cherokee.conf:

vserver!100!rule!600!encoder!gzip = 1
vserver!100!rule!600!handler = uwsgi
vserver!100!rule!600!handler!balancer = round_robin
vserver!100!rule!600!handler!balancer!source!1 = 31
vserver!100!rule!600!handler!check_file = 0
vserver!100!rule!600!handler!error_handler = 1
vserver!100!rule!600!handler!pass_req_headers = 1
vserver!100!rule!600!match = request
vserver!100!rule!600!match!directory = /app

I have run uwsgi manually from the command line and I can see that Cherokee is correctly passing on the entire relative path to uwsgi:

[pid: 8778|app: 1|req: 3/3] 124.168.27.217 () {56 vars in 1356 bytes} [Thu Oct 21 21:30:21 2010] GET /app/ => generated 2977 bytes in 4 msecs (HTTP/1.1 404) 2 headers in 80 bytes (0 async switches on async core 0) [pid: 8778|app: 1|req: 7/7] 124.168.27.217 () {58 vars in 1473 bytes} [Thu Oct 21 21:31:53 2010] GET /app/login => generated 2977 bytes in 5 msecs (HTTP/1.1 404) 2 headers in 80 bytes (0 async switches on async core 0) [pid: 8778|app: 1|req: 8/8] 121.44.162.72 () {56 vars in 1574 bytes} [Thu Oct 21 21:31:54 2010] GET /app/app => generated 2977 bytes in 8 msecs (HTTP/1.1 404) 2 headers in 80 bytes (0 async switches on async core 0) [pid: 8778|app: 1|req: 9/9] 121.44.162.72 () {56 vars in 1598 bytes} [Thu Oct 21 21:31:57 2010] GET /app/app/login => generated 0 bytes in 1 msecs (HTTP/1.1 301) 2 headers in 135 bytes (0 async switches on async core 0) [pid: 8778|app: 1|req: 10/10] 121.44.162.72 () {60 vars in 1713 bytes} [Thu Oct 21 21:31:57 2010] GET /app/app/login/ => generated 3966 bytes in 13 msecs (HTTP/1.1 200) 8 headers in 431 bytes (0 async switches on async core 0)

I have the following in uwsgi.xml:

<uwsgi>
<pythonpath>/var/www/example/</pythonpath>
<pythonpath>/var/www/</pythonpath>
<app mountpoint="/">
<script>django_wsgi</script>
</app>
</uwsgi>

I have also tried changing the mountpoint to "/app" and "/app/" but it has had no effect.

Can anyone tell me why I am getting this weird behaviour with uWSGI? How do I make it so that the same URLs work in development and in production?

Thanks.

David.
_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to