Welcome! Log In Create A New Profile

Advanced

Re: Rewrite Subdomains to Paths (Valentin V. Bartenev)

Kurtis Mullins
March 26, 2012 10:16AM
Hello,

Thanks for the quick reply. I apologize ahead-of-time if this is the
incorrect way to reply to messages on here. I have my notification settings
set to once per day.

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? Basically, when the user accesses
username.example.com/foo/bar/then my WSGI Application would just see "
example.com/username/foo/bar/". I'm trying to get around a limitation of
django where it processes URLs based on the path alone. I mainly want this
done dynamically so I don't have thousands of configuration directives
going on.

Thanks again!


> ------------------------------
>
> Message: 3
> Date: Thu, 22 Mar 2012 00:33:02 +0400
> From: "Valentin V. Bartenev" <ne@vbart.ru>
> To: nginx@nginx.org
> Subject: Re: Rewrite Subdomains to Paths
> Message-ID: <201203220033.02956.ne@vbart.ru>
> Content-Type: Text/Plain; charset="iso-8859-6"
>
> On Thursday 22 March 2012 00:15:00 Kurtis Mullins wrote:
> > Hey,
> >
> > Is it possible to rewrite subdomains to paths? I want to do something
> like
> > this:
> >
> > x.example.com/foo/bar/ -> www.example.com/x/foo/bar/
> >
>
> server {
> server_name ~^(?P<subdomain>.+)\.example\.com$;
>
> location / {
> return 301 http://www.example.com/$subdomain$request_uri;
> }
> }
>
> wbr, Valentin V. Bartenev
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Re: Rewrite Subdomains to Paths (Valentin V. Bartenev)

Kurtis Mullins March 26, 2012 10:16AM

Re: Rewrite Subdomains to Paths (Valentin V. Bartenev)

Francis Daly March 26, 2012 12:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 214
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready