Welcome! Log In Create A New Profile

Advanced

Re: nginx rewrite question

July 09, 2009 04:40AM
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 justfornow.com 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 http://try.justfornow.com nginx rewrites it to
> https://try.justfornow.com
> user calls http://anything.justfornow.com nginx keeps the first part and
> rewrites it to https://anything.justfornow.com

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


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

nginx rewrite question

Juergen Gotteswinter July 09, 2009 04:35AM

Re: nginx rewrite question

Igor Sysoev July 09, 2009 04:40AM

Re: Nginx rewrite question

Igor Sysoev March 29, 2011 05:40AM

Re: Nginx rewrite question

jinjun502 March 29, 2011 08:59AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 150
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready