Francis Daly
January 10, 2013 11:14AM
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
--
Francis Daly francis@daoine.org

_______________________________________________
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: 298
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