Welcome! Log In Create A New Profile

Advanced

Re: Redirect loop problems

October 15, 2014 11:10AM
Hi,

Problem solved, on conf.d directory, there is active HSTS directive,
that's why the HTTP forcing to HTTPS, wherever I force them back to http.

Thanks anyway.

On 10/15/2014 12:02 AM, crazy world wrote:
> Can you grab the http conversation from the browser or run tcpdump to show the difference between curl and the browser? The client sends the different thing to the server which is confirmed.
>
> -B
>
>> Date: Tue, 14 Oct 2014 12:37:33 +0700
>> From: dewanggaba@xtremenitro.org
>> To: nginx@nginx.org
>> Subject: Re: Redirect loop problems
>>
>> Update:
>>
>> I just want to redirect specific URL contains `/go/*` to HTTP, and force
>> others to HTTPS.
>>
>> On 10/14/2014 12:03 PM, Dewangga Bachrul Alam wrote:
>>> Hi,
>>>
>>> Today, I was implement redirect using return 301, here's my snippet:
>>>
>>> server {
>>> listen 80;
>>> server_name domain.tld;
>>> error_log /dev/null;
>>> access_log off;
>>> return 301 https://www.domain.tld$request_uri;
>>> }
>>>
>>> server {
>>> listen 80;
>>> server_name www.domain.tld;
>>> error_log /dev/null;
>>> access_log off;
>>>
>>> location ^~ /go/ {
>>> # Apache2 Backend
>>> proxy_pass http://127.0.0.1:8080
>>> }
>>> location / {
>>> return 301 https://$http_host$request_uri$is_args$query_string;
>>> }
>>> }
>>>
>>> server {
>>> listen 443 ssl spdy;
>>> server_name domain.tld;
>>> return 301 https://www.domain.tld$request_uri;
>>>
>>> error_log /dev/null;
>>> access_log off;
>>>
>>> ssl on;
>>> ssl_certificate bundle.crt;
>>> ssl_certificate_key file.key;
>>> ssl_verify_depth 2;
>>> }
>>>
>>> server {
>>> listen 443 ssl spdy;
>>> server_name www.domain.tld;
>>> location ^~ /go/ {
>>> return 301 http://$http_host$request_uri;
>>> }
>>> location / {
>>> # Apache2 Backend
>>> proxy_pass http://127.0.0.1:8080
>>> }
>>> }
>>>
>>> The problem is, if the visitor hit `/go/` URL, the browser says it's
>>> redirect loop, but if I try `curl -I` command the `/go/` URL, it's
>>> normal, and says HTTP 200.
>>>
>>> Any hints? Really appreciate any helps.
>>>
>>
>> _______________________________________________
>> nginx mailing list
>> nginx@nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>
>
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>

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

Redirect loop problems

dewanggaba October 14, 2014 01:04AM

Re: Redirect loop problems

dewanggaba October 14, 2014 01:38AM

RE: Redirect loop problems

crazy world October 14, 2014 01:04PM

Re: Redirect loop problems

dewanggaba October 15, 2014 11:10AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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