Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

How to serve PHP files outside the public folder? (3 replies)

$
0
0
For serving the PHP scripts, I use this location

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}

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?

Viewing all articles
Browse latest Browse all 7229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>