

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
14 messages in ru.sysoev.nginxRe: Rewriting https to http| From | Sent On | Attachments |
|---|---|---|
| iane...@public.gmane.org | Jan 11, 2007 1:26 pm | |
| Igor Sysoev | Jan 11, 2007 1:40 pm | |
| Jonathan Dance | Jan 12, 2007 3:56 am | |
| Jonathan Dance | Jan 12, 2007 4:06 am | |
| Igor Sysoev | Jan 12, 2007 4:16 am | |
| Igor Sysoev | Jan 12, 2007 4:32 am | |
| Jonathan Dance | Jan 12, 2007 4:33 am | |
| Jonathan Dance | Jan 12, 2007 4:40 am | |
| Igor Sysoev | Jan 12, 2007 4:42 am | |
| Igor Sysoev | Jan 12, 2007 4:45 am | |
| Jonathan Dance | Jan 12, 2007 5:20 am | |
| Igor Sysoev | Jan 12, 2007 5:35 am | |
| Igor Sysoev | Jan 12, 2007 6:41 am | |
| Jonathan Dance | Jan 12, 2007 6:55 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: Rewriting https to http | Actions... |
|---|---|---|
| From: | Igor Sysoev (is-G...@public.gmane.org) | |
| Date: | Jan 12, 2007 4:32:43 am | |
| List: | ru.sysoev.nginx | |
On Fri, 12 Jan 2007, Jonathan Dance wrote:
The order of locaiton processing is described here: http://wiki.codemongers.com/NginxHttpCoreModule#location
As previously mentioned there, the documentation for this (very important) command is quite hard to understand and was in need of attention. So, after much re-reading and using Google translate on the Russian docs, I think I understood it and completely rewrote that section. I would appreciate it if Igor and the other nginx team members could review it to make sure it is correct.
One note:
These strings are sorted internally from longest to shortest, allowing the most specific string to be matched first.
It's not correct. Please, correct my spell:
nginx finds the longest match to conventional string. These strings are sorted internally in lexical order, so the search is terminstaed just when URI became lexically more than a string.
RewriteCond %{SERVER_PORT} ^443$ RewriteCond $1 !^(securedir|2ndsecuredir|3rdsecuredir)/ [NC,OR] RewriteCond $1 !\.(css|gif|jpe?g|bmp|js|inc)$ [NC] RewriteRule ^/(.*) http://www.example.com/$1 [R=301,L]
Igor's example will work but I might recommend folding it into a single regex so you only have a single location block to configure, e.g.:
location ~* "^(securedir|2ndsecuredir|3rdsecuredir)|\.(css|gif|jpe?g|bmp|js|inc)$" { }
This is slower than using the non-regex versions like Igor did but for me the convenience of a shorter configuration file outweighs the performance hit of a regex call... besides, the regex was going to be called anyway unless you use ^~ (see the docs :) ).
Of course, if your configurations for these locations are equal, you may use one big regex.
Igor Sysoev http://sysoev.ru/en/







