投稿
投稿者文章

333
555
888
69 45 373 `server { listen 80; server_name blog.example.com; root /www/wwwroot/blog; index index.php;
charset utf-8; client_max_body_size 20m;
# 禁止访问程序与数据目录 location ~ ^/(app|data)/ { deny all; return 404; }
# 禁止上传目录执行 PHP location ~ ^/uploads/.\.(php|phtml|php5)$ { deny all; return 404; }
# 后台(可选,后台链接本身是 query 形式) location /admin/ { try_files $uri $uri/ /admin/index.php?r=$uri&$args; }
# 全站伪静态:文章、分类、标签、作者、归档、微语、友链、 # 相册、搜索、登录注册、评论提交、点赞接口等全部覆盖 location / { try_files $uri $uri/ /index.php?r=$uri&$args; }
location = /sitemap.xml { rewrite ^ /index.php?r=/sitemap.xml last; }
location = /robots.txt { rewrite ^ /robots.php last; }
location ~ \.php$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass unix:/run/php/php8.2-fpm.sock; } }`
20
- 45
- 77
- 55
| 项目 | 说明 |
|---|---|
| 内容 | 内容 |
define('PRETTY_URLS', true);
评论 0
保持友善,认真交流还没有评论,来说两句吧。