nginx rewrite question

Igor Sysoev is at
Thu Jul 9 12:40:29 MSD 2009

On Thu, Jul 09, 2009 at 10:35:45AM +0200, Juergen Gotteswinter wrote:

> Hello,
> perhaps someone here could help me with the following problem. i got a 
> domain which got a wildcard dns entry, and i need to 
> redirect this domain to https. but i have to keep the first part of the 
> domain, for example:
> user calls nginx rewrites it to 
> user calls nginx keeps the first part and 
> rewrites it to

server {
    listen       80;
    server_name  *;
    rewrite      ^    https://$host$request_uri?  permanent;

Igor Sysoev

More information about the nginx mailing list