Hi.
I have problem with redirection in webpy and nginx. I setted up
nginx-0.7.64 and webpy-0.33 on my FreeBSD 8.0 box (hostname: kappa).
Here is simple script:
import web
urls = (
'/t', 'index',
)
app = web.application(urls, globals())
class index:
def GET(self):
web.seeother('/static/test.txt')
if __name__ == "__main__": app.run()
If I run script just from command line, redirect works fine and
getting me in http://kappa/static/test.txt.
If run from from nginx, I have redirect to http://kappa/t/static/test.txt.
No matter if I using rewrite in nginx.conf or no, situation is the
same.
Tell me please, what am I doing wrong. Thanks!
webpy application starts with spawn-fcgi (spawn-fcgi -d /usr/local/www/
hello -f /usr/local/www/hello/hello.py -a 127.0.0.1 -p 9002)
Here is nginx's config file:
http {
include mime.types;
default_type application/octet-stream;
server {
listen 80;
server_name localhost;
location / {
include /usr/local/etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_pass 127.0.0.1:9002;
}
location /static/ {
if (-f $request_filename) {
rewrite ^/static/(.*)$ /static/$1 break;
}
}
}
}
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.