https rewrite for subdirectory only

gunawan satemie at gmail.com
Sun Dec 26 16:59:52 MSK 2010


Ok, thanks.

On Sun, 26 Dec 2010 18:17:33 +0800, Edho P Arief <edhoprima at gmail.com>  
wrote:

> On Sun, Dec 26, 2010 at 5:13 PM, gunawan <satemie at gmail.com> wrote:
>> Attached is the nginx.conf file, no separtion between server 80 and  
>> server
>> 443.
>>
>> If I make separation between server 80 and server 443, it's ok.
>>
>
> That's the problem.
>
> Also it's recommended to make separate block for http and https.
>
> Here's what happens:
>
> 1. access http://$server_name/admin
> 2. matches /admin { } block, nginx redirects to  
> https://$server_name/admin
> 3. matches /admin { } block, nginx redirects to  
> https://$server_name/admin
> 4. repeat for infinity
>
> Firefox sanely stops following redirection when it detects such loop.
>
> tip: use
>
> rewrite ^ https://$server_name$request_uri?$args permanent;
>
> instead of
>
> rewrite     ^(.*)   https://$server_name$1 permanent;
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx





More information about the nginx mailing list