Remove URI string?

Francis Daly francis at daoine.org
Thu Jan 10 16:13:20 UTC 2013


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 at 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 at daoine.org



More information about the nginx mailing list