redirect from http to https

Steve Zhuo lists at ruby-forum.com
Mon Mar 9 03:08:10 MSK 2009


Hi mike, i have a upstream portion:

upstream mysvr   {
        server 127.0.0.1 weight=1;
}


Is there other things i'm missing besides rewrite module to do the 
redirect from http to https?  I'm still new to nginx. any help is 
appreciated.. Thank You



mike wrote:
> On Sun, Mar 8, 2009 at 3:04 PM, Steve Zhuo <lists at ruby-forum.com> wrote:
>> Hi, thanks for the reply, i enable SSL on port 443, i just didn't paste
>> it.  Here is a more complete version.  if i use https://domain.com, it
>> works no problem, just when i tried to redirect from http to https, it
>> went into a redirect loop..
> 
> i don't see why it would be (first off)
> 
> try using lynx -mime_header http://foo.com/ and see what it says. i do
> http to https all the time without an issue. you need to inspect the
> headers and what is happening on the client side. firebug for firefox
> or fiddler even could help too.
> 
> why do you have this chunk? these headers are being sent to the
> upstream and there is no upstream.
> 
>> location / {
>>
>>                 # needed for HTTPS
>>                 proxy_set_header  X-Real-IP  $remote_addr;
>>                 proxy_set_header  X-Forwarded-For
>> $proxy_add_x_forwarded_for;
>>                 proxy_set_header Host $http_host;
>>        }
>> }
> 
>>
>>
>>  location / {
>>      proxy_pass  http://mysvr;
> 
> this would be where you would put the proxy_set_headers

-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list