Welcome! Log In Create A New Profile

Advanced

try_files php

Marcos Neves
May 27, 2010 02:18PM
How can I reproduce this behavior:

with a request to /foo/bar

try file: foo/bar
try index.htm: foo/bar/
try file: foo/bar.htm
try file: foo/bar.html
try parse php: foo/bar.php
try file: /layout.htm
try file: /layout.html
try parse php: /layout.php
return 404 if not found.

I try this:

location / {
try_files $uri $uri/ $uri.htm $uri.html $uri.php layout.htm
/layout.html /layout.php;
}

Everything works, except PHP that returns as text file showing the source code.

ps: Is there a blog post that explain exactly how location, if,
rewrite and try_files works?
The docs are not so clear about how the flow works.

Marcos Neves

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

try_files php

Marcos Neves May 27, 2010 02:18PM

Re: try_files php

mike May 27, 2010 02:32PM

Re: try_files php

Marcos Neves May 27, 2010 02:38PM

Re: try_files php

mike May 27, 2010 02:44PM

Re: try_files php

edogawaconan May 27, 2010 02:44PM

Re: try_files php

☣Merlin May 27, 2010 02:58PM

Re: try_files php

Igor Sysoev May 27, 2010 03:08PM

Re: try_files php

Marcos Neves May 27, 2010 03:18PM

Re: try_files php

Igor Sysoev May 27, 2010 03:28PM

Re: try_files php

Marcos Neves May 27, 2010 03:42PM

Re: try_files php

Igor Sysoev May 27, 2010 03:42PM

Re: try_files php

Marcos Neves May 27, 2010 04:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 176
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