Welcome! Log In Create A New Profile

Advanced

Re: location expression - PHP treated as binary file

Edho Arief
September 24, 2012 11:26PM
On Tue, Sep 25, 2012 at 10:04 AM, technoplague <nginx-forum@nginx.us> wrote:
> Hi,
>
> Having following configuration, PHP files, if requested from /junk or /pub
> locations, are treated as binary. Sample request - domain.com/pub/i.php ->
> file is downloaded to PC instead of executing.
>
> Have no problems serving PHP files from other locations. Having separate
> locations for /pub /junk with autoindex also works, however my intention is
> to combine them in one expression.
>

That's because when both locations are regexp, the first match is used
while when it's regexp and normal, regexp is used. Try moving the php
block to the top.

Check this reference: http://wiki.nginx.org/HttpCoreModule#location

(it would be nice if the order list is also copied to official docs.
The current one which describes it in prose form is harder to read)

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

location expression - PHP treated as binary file

technoplague September 24, 2012 11:04PM

Re: location expression - PHP treated as binary file

Edho Arief September 24, 2012 11:26PM

Re: location expression - PHP treated as binary file

technoplague September 25, 2012 12:03AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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