trying to get alias and seo urls working with uwsgi but no luck

chenxee nginx-forum at
Fri Feb 11 12:54:18 MSK 2011

hi there,

I'm new to nginx and trying to configure nginx and uwsgi to get
alias+seo url working, something like this: - /shop is an alias and shop dir
doesnt exist in filesystem under doc root, and this url trying to pass
query string as ?product=123

to get alias working, my config:

location /shop {  
  alias     /public/webshop;    

location ~ ^/shop.+\.py$ {
  root /public/webshop;  
  rewrite /shop/(.*\.py?)$ /$1 break;
  include    uwsgi_params;  
  uwsgi_pass unix:$uwsgi_socket;    

It's working fine, as finds
"/public/webshop/" and pass to uwsgi socket. However always report 404 not found - nginx
tries to locate "/public/webshop/product/123" and ofc it's not there..
whereas works fine as usual.

What I'm trying is to forward all request starting with /shop to
/public/webshop/ and let python script parses url. I have tried
googled a lot nginx rewrite rules, e.g. [code]
rewrite ^/shop/(.*)$ /$1 permanent;
but with no luck. Maybe I'm so bad at understand nginx rewrite,
therefore looking for any advice here.

Any thoughts would be appreciated.


Posted at Nginx Forum:,174087,174087#msg-174087

More information about the nginx mailing list