January 10, 2013 06:25PM
Francis Daly Wrote:
-------------------------------------------------------
> On Thu, Jan 10, 2013 at 11:37:44AM +0700, Edho Arief wrote:
> > On Thu, Jan 10, 2013 at 11:35 AM, daveyfx <nginx-forum@nginx.us>
> wrote:
>
> Hi there,
>
> > > I gave it a try and it did not work out. My access log repeated
> the
> > > following entry ~ 20 times.
>
> As mentioned:
>
> curl -i http://server/something
> curl -i http://server/
>
> are much friendlier for testing with. You'll see exactly what the
> server
> sends back.
>
> > location = / {
> > index index.html;
> > }
> > location / {
> > return 302 /;
> > }
>
> With that configuration, a request for / will lead to an internal
> rewrite to /index.html, which will then hit the second location and do
> an external redirect again.
>
> So either add a third "location = /index.html" to handle that, or
> avoid
> the internal rewrite by doing something like
>
> try_files /index.html =404
>
> in the "location = /" block.
>
> f

To all -

Thank you for your help with this. Francis put the puzzle together and the following is working out great for me.

server {
server_name
host1.domain.com
host2.domain.com
...
... (so on and so forth)

root /path/to/document/root;

location = / {
try_files /index.html = 404;
}

location / {
return 302 /;
}
}

> --
> Francis Daly francis@daoine.org
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: 274
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