Forcing SSL (https)

Igor Sysoev is at rambler-co.ru
Wed Aug 29 19:25:27 MSD 2007


On Wed, Aug 29, 2007 at 11:03:37AM -0400, Wayne E. Seguin wrote:

> This does not preserve the subdomain:
> 
> server {
>   listen 80;
>   server_name mydomain.tld;
>   rewrite  ^(.*)  https://mydomain.tld$1  redirect;
> }
> 
> What is the best way to redirect http => https while preserving  
> subdomains?

   rewrite  ^(.*)  https://$host$1  redirect;


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





More information about the nginx mailing list