<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>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.<br><br>-B<br><br><div>> Date: Tue, 14 Oct 2014 12:37:33 +0700<br>> From: dewanggaba@xtremenitro.org<br>> To: nginx@nginx.org<br>> Subject: Re: Redirect loop problems<br>> <br>> Update:<br>> <br>> I just want to redirect specific URL contains `/go/*` to HTTP, and force<br>> others to HTTPS.<br>> <br>> On 10/14/2014 12:03 PM, Dewangga Bachrul Alam wrote:<br>> > Hi,<br>> > <br>> > Today, I was implement redirect using return 301, here's my snippet:<br>> > <br>> > server {<br>> > listen 80;<br>> > server_name domain.tld;<br>> > error_log /dev/null;<br>> > access_log off;<br>> > return 301 https://www.domain.tld$request_uri;<br>> > }<br>> > <br>> > server {<br>> > listen 80;<br>> > server_name www.domain.tld;<br>> > error_log /dev/null;<br>> > access_log off;<br>> > <br>> > location ^~ /go/ {<br>> > # Apache2 Backend<br>> > proxy_pass http://127.0.0.1:8080<br>> > }<br>> > location / {<br>> > return 301 https://$http_host$request_uri$is_args$query_string;<br>> > }<br>> > }<br>> > <br>> > server {<br>> > listen 443 ssl spdy;<br>> > server_name domain.tld;<br>> > return 301 https://www.domain.tld$request_uri;<br>> > <br>> > error_log /dev/null;<br>> > access_log off;<br>> > <br>> > ssl on;<br>> > ssl_certificate bundle.crt;<br>> > ssl_certificate_key file.key;<br>> > ssl_verify_depth 2;<br>> > }<br>> > <br>> > server {<br>> > listen 443 ssl spdy;<br>> > server_name www.domain.tld;<br>> > location ^~ /go/ {<br>> > return 301 http://$http_host$request_uri;<br>> > }<br>> > location / {<br>> > # Apache2 Backend<br>> > proxy_pass http://127.0.0.1:8080<br>> > }<br>> > }<br>> > <br>> > The problem is, if the visitor hit `/go/` URL, the browser says it's<br>> > redirect loop, but if I try `curl -I` command the `/go/` URL, it's<br>> > normal, and says HTTP 200.<br>> > <br>> > Any hints? Really appreciate any helps.<br>> > <br>> <br>> _______________________________________________<br>> nginx mailing list<br>> nginx@nginx.org<br>> http://mailman.nginx.org/mailman/listinfo/nginx<br></div> </div></body>
</html>