question regarding rewrite from http to https

Mansoor Peerbhoy mansoor at zimbra.com
Thu Jun 12 10:26:26 MSD 2008


Gracias, Igor -- Vielen Dank 

Regards,
Mansoor

----- Original Message -----
From: "Igor Sysoev" <is at rambler-co.ru>
To: nginx at sysoev.ru
Sent: Wednesday, June 11, 2008 6:31:27 PM GMT +05:30 Chennai, Kolkata, Mumbai, New Delhi
Subject: Re: question regarding rewrite from http to https

On Wed, Jun 11, 2008 at 04:29:11AM -0700, Mansoor Peerbhoy wrote:

> Hello,
> 
> I am using NGINX as an HTTP proxy, and in some cases, I need to rewrite all requests from http:// to https://
> My proxy configuration has two server {} blocks, one with http, and one with https
> 
> So if my sample configuration looks like: (assume proxy server name is proxy.com)
> 
> server
> {
>   listen 80;
>   location /
>   {
>     rewrite ^/(.*)$ https://proxy.com/$1;

-     rewrite ^/(.*)$ https://proxy.com/$1;
+     rewrite ^/(.*)$ https://proxy.com/$1  redirect;

>   }
> }
> 
> server 
> {
>   listen 443;
>   ...
> }


-- 
Igor Sysoev
http://sysoev.ru/en/






More information about the nginx mailing list