ledy Asked: 2012-06-20 07:30:09 +0800 CST2012-06-20 07:30:09 +0800 CST 2012-06-20 07:30:09 +0800 CST nginx: secure php sources by default config 772 Mistakes in the php {} part of vhost configuration files make php files to be "readable" with its source code like text files Is there a global setting, e.g. in the default config to forbid accessing php files without fastcgi? fastcgi nginx 1 Answers Voted Best Answer Logic Wreck 2012-06-21T02:03:08+08:002012-06-21T02:03:08+08:00 You could just use: location ~ \.php$ { deny all; } in case you want to make php files to be not accessible server wide or: location ~ /path/to/dir/(.+)\.php$ { deny all; } For a specific location.
You could just use:
in case you want to make php files to be not accessible server wide or:
For a specific location.