Welcome! Log In Create A New Profile

Advanced

Re: Remove URI string?

Jonathan Matthews
January 09, 2013 11:44AM
On 9 January 2013 16:35, daveyfx <nginx-forum@nginx.us> wrote:
> Hello all -
>
> I would like to strip all request_uri strings for a group of server names
> and serve up an index page.
> Example:
>
> Client requests http://host1.domain.com/blah, nginx will direct client to
> http://host1.domain.com and serve the index page. Same scenario for host2 -
> I would like nginx to direct client to http://host2.domain.com and serve the
> same index page.
>
> Would the below work?
>
> server {
> server_name host1.domain.com host2.domain.com;
> rewrite ^ http://$server_name;
> root /path/to/document/root;
> index index.html;
> }

Have you tried it? How about doing that?

It looks ok to me, but running it on a test machine will probably tell
you all you need to know ...

Jonathan
--
Jonathan Matthews // Oxford, London, UK
http://www.jpluscplusm.com/contact.html

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Remove URI string?

daveyfx January 09, 2013 01:41AM

Re: Remove URI string?

Jonathan Matthews January 09, 2013 11:44AM

Re: Remove URI string?

daveyfx January 09, 2013 11:35PM

Re: Remove URI string?

Edho Arief January 09, 2013 11:40PM

Re: Remove URI string?

daveyfx January 10, 2013 09:29AM

Re: Remove URI string?

Edho Arief January 10, 2013 09:44AM

Re: Remove URI string?

Francis Daly January 10, 2013 11:14AM

Re: Remove URI string?

daveyfx January 10, 2013 06:25PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 81
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready