Welcome! Log In Create A New Profile

Advanced

Re: Remove URI string?

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
SubjectAuthorPosted

Remove URI string?

daveyfxJanuary 09, 2013 01:41AM

Re: Remove URI string?

Jonathan MatthewsJanuary 09, 2013 11:44AM

Re: Remove URI string?

daveyfxJanuary 09, 2013 11:35PM

Re: Remove URI string?

Edho AriefJanuary 09, 2013 11:40PM

Re: Remove URI string?

daveyfxJanuary 10, 2013 09:29AM

Re: Remove URI string?

Edho AriefJanuary 10, 2013 09:44AM

Re: Remove URI string?

Francis DalyJanuary 10, 2013 11:14AM

Re: Remove URI string?

daveyfxJanuary 10, 2013 06:25PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 66
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 156 on March 20, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready