A
A
Alexander Vladimirovich2015-02-26 10:05:36
Nginx
Alexander Vladimirovich, 2015-02-26 10:05:36

How to allow php files to be executed only from a specified directory?

Hello!
The root of the site is in /var/www/site/www/
How to allow execution of only those php files that are in the directory
/var/www/site/www/scripts/user/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Ergil Osin, 2015-02-26
@Ernillew

location / {
        root  /var/www/site/www/;
}

location ~ \.php$ {

        root /var/www/site/www/scripts/user/;
        fastcgi_pass   127.0.0.1:9001;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
}

Something like this.
Adjust for yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question