How to configure nginx to prohibit directory execution of php files: [location ~ /dir/.*.(php|php5)?$ {deny all;}]. After the configuration is completed, the web service needs to be restarted.
Prohibit dir directory execution php file permissions
(Recommended tutorial: nginx tutorial)
location ~ /dir/.*.(php|php5)?$ { deny all; }
Multiple directories
(Learning video recommendation: php video tutorial)
Prohibit dir and upload directories from executing php file permissions
location ~ /(dir|upload)/.*.(php|php5)?$ { deny all; }
After the configuration is complete, restart the web service.
The above is the detailed content of How to configure nginx to prohibit directory execution of php files. For more information, please follow other related articles on the PHP Chinese website!