Welcome! Log In Create A New Profile

Advanced

Re: Converting subdomain to path component without redirect ?

Francis Daly
May 05, 2013 04:18AM
On Sun, May 05, 2013 at 02:38:17AM +0100, henrique matias wrote:

Hi there,

> Also i tried adding the address to the try_files:
>
> try_files $uri $uri @app/de/; and try_files $uri $uri @app/de;
>
> but that didn't work either.

Unless you also added new named locations like "@app/de/", I'd expect
that to return HTTP 500.

That's a more specific problem report than "didn't work".

> The core basic of my problem is "Rewrite the URL based on the "server
> name"".
>
> So far the only options i see on nginx are:
>
> 1. Have a configuration with one "if" and one "rewrite" in order to map
> server name to path

http://nginx.org/r/map

Set a (possibly empty) variable called (say) $path_prefix, and then use
that in your rewrite or proxy_pass line.

Note that using a variable in proxy_pass has other requirements too:

http://nginx.org/r/proxy_pass

> 2. Multiple server declarations sharing the same configuration ( probably
> using some sort of include? )

Can work, if the shared configuration is truly the same.

> What you reckon? Any suggestion ?

I still think that until you demonstrate that your back-end works with
this, the rest is not useful.

Test one thing at a time, and keep the configuration simple.

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Converting subdomain to path component without redirect ?

henrique matias April 29, 2013 05:04PM

Re: Converting subdomain to path component without redirect ?

henrique matias April 30, 2013 07:10AM

Re: Converting subdomain to path component without redirect ?

Francis Daly May 04, 2013 05:50PM

Re: Converting subdomain to path component without redirect ?

henrique matias May 04, 2013 09:24PM

Re: Converting subdomain to path component without redirect ?

henrique matias May 04, 2013 09:40PM

Re: Converting subdomain to path component without redirect ?

Francis Daly May 05, 2013 04:18AM

Re: Converting subdomain to path component without redirect ?

henrique matias May 05, 2013 07:16PM

Re: Converting subdomain to path component without redirect ?

GreenGecko May 05, 2013 07:26PM

Re: Converting subdomain to path component without redirect ?

henrique matias May 06, 2013 11:36AM

Re: Converting subdomain to path component without redirect ?

Francis Daly May 05, 2013 04:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 262
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready