How to generate url with sub domain to new url with query string?

Hi everyone,

I’m very new with Nginx, and now I want to use Nginx to generate new url
from the url user passed.
Example:
User type to browser like http://us.domain.com, and I want Nginx
generates to Website Domain Names, Online Stores & Hosting | Domain.com or
Website Domain Names, Online Stores & Hosting | Domain.com.

How can I rewrite the nginx to do this?

Best regards,
Leakhina

Posted at Nginx Forum:

On Mon, Jun 22, 2009 at 01:37:40AM -0400, leakhina wrote:

Hi everyone,

I’m very new with Nginx, and now I want to use Nginx to generate new url from the url user passed.
Example:
User type to browser like http://us.domain.com, and I want Nginx generates to Website Domain Names, Online Stores & Hosting - Domain.com or Website Domain Names, Online Stores & Hosting - Domain.com.

How can I rewrite the nginx to do this?

Do you mean redirect sent to client ?

On Mon, Jun 22, 2009 at 12:37 PM, leakhina[email protected] wrote:

Posted at Nginx Forum: How to generate url with sub domain to new url with query string?

maybe something like this

server {
listen 80;
server_name ~(.).domain.com;
set $loc $1;
rewrite ^.
http://domain.com$request_uri?portal=$loc;
}

Yesh

Posted at Nginx Forum: