Welcome! Log In Create A New Profile

Advanced

Re: [Nginx Config] rewrite host

August 25, 2009 10:21AM
> For example :
> if( $host ~* "(.*)\.[a-zA-Z0-9_-]*\.[a-zA-Z]{2,4}" )
> {
> addGet sd $1;
> }
>
> This code add "?sd=$1" or "&sd=$1" (if there are already arguments GET before or not)
>
> If not exist how can I do for write this function (or code who make the same ?)
>
> Thank you and sorry for my english (I'm french :p)

Hello.

If I understand correctly, you need something like this:

[code]
server {
listen 80;
server_name ~(.*)\..*\..*;
rewrite ^ /$request_uri&$1;
}
[/code]
Subject Author Posted

[Nginx Config] rewrite host

CactO_o's August 20, 2009 08:37AM

Re: [Nginx Config] rewrite host

CactO_o's August 25, 2009 09:08AM

Re: [Nginx Config] rewrite host

shaktale August 25, 2009 10:21AM

Re: [Nginx Config] rewrite host

edogawaconan August 25, 2009 10:03AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 114
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