Welcome! Log In Create A New Profile

Advanced

Re: map $uri in 1.3.0+ NOT working in 1.6.0+

October 04, 2014 12:20AM
Hi Valentin,

I am not sure that what you provided is exactly what I am trying to achieve.

What I want is if someone hits port 80 (HTTP) with /account that they redirect to /account on port 443 (HTTPS). However, if they come in on port 443 (HTTPS) with /account that they remain on port 443 (HTTPS). Similar rules exist for keeping certain URI's on HTTP or allowing certain URIs to use HTTP/HTTPS (basically we don't care).

With the example you provided I would need to embed these location directives into the respective Server sections of our main template file (unless I am missing something) and thus would introduce domain / application specific behaviour into the template VS. how we are doing it now in that application specific behaviour is limited to pre-pended or post-pended include files so as to create clean separation across multiple domains.

While the map directive may not be the most efficient it has the benefits of being the most compact, easiest to maintain and that it can be decoupled from our core common Nginx template files i.e. it can live outside the Server directive. So at this point its a tradeoff between simplicity and speed.

Just how bad will the map (say about a dozen mappings) perform in comparison to location directives?
Subject Author Posted

map $uri in 1.3.0+ NOT working in 1.6.0+

nikolaos2012 October 02, 2014 11:08PM

Re: map $uri in 1.3.0+ NOT working in 1.6.0+

nikolaos2012 October 03, 2014 12:58AM

Re: map $uri in 1.3.0+ NOT working in 1.6.0+

Valentin V. Bartenev October 03, 2014 05:02AM

Re: map $uri in 1.3.0+ NOT working in 1.6.0+

nikolaos2012 October 03, 2014 09:04AM

Re: map $uri in 1.3.0+ NOT working in 1.6.0+

Valentin V. Bartenev October 03, 2014 03:00PM

Re: map $uri in 1.3.0+ NOT working in 1.6.0+

nikolaos2012 October 04, 2014 12:20AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 277
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