How to serve PHP files outside the public folder?

Francis Daly francis at daoine.org
Mon Aug 26 22:12:15 UTC 2013


On Sun, Aug 25, 2013 at 03:14:55AM -0400, etrader wrote:

> now I want to keep a folder outside the public folder to be served as a
> 
> location /private/ {
> /* serving static files from /private/$server_name/ */
> location ~ \.php$ {
> /* serving PHP scripts from /private/$server_name/ */
> }
> }
> 
> How should set this location to serve the files from outside the public
> folder?

http://nginx.org/r/location

Probably one of "location ^~ /private/"; or else "location ~
/private/*.\php$" before your "location ~ \.php$", should work.

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list