Rewrite Subdomains to Paths (Valentin V. Bartenev)

Francis Daly francis at
Mon Mar 26 16:28:52 UTC 2012

On Mon, Mar 26, 2012 at 10:14:53AM -0400, Kurtis Mullins wrote:

Hi there,

> Anyways, this would definitely work for redirects. Is it possible to do it
> in a way that is transparent to the end-user and my WSGI Application
> server?

That's (mostly) up to your application server.

> Basically, when the user accesses
> my WSGI Application would just see "

On the nginx side, you "just" adjust the uwsgi_param values that you send.
(Assuming that's how nginx access the application.)

But before you do that: try accessing the WSGI Application using the style urls. Look in the returned content. Do
you see the string "username" anywhere? Do you see any linked content
with a url that starts "/" or with multiple "../"? Do you see any linked
content with a url that includes ""?

If you do, consider how they will look to a client which thinks that
its initial request was to

You can get nginx to mangle http headers. You shouldn't get nginx to
mangle the http body.

It can work. But it is worth testing your particular setup to make sure
that it works for you.

Francis Daly        francis at

More information about the nginx mailing list