以下配置仅供参考,请根据自身情况进行调整
1,
- location / {
- index index.php;
- if ($uri !~* ^/(index\.php|robots\.txt)) {
- return 403;
- }
- }
复制代码
2,
- location ~ /(application|config|extend|public|route|runtime|thinkphp|vendor)/ {
- deny all;
- return 403;
- }
复制代码
3,
- location /public {
- location ~* \.(php|sh|pl|py)$ {
- deny all;
- }
复制代码 |