下载最新版5.9 ngixn伪静态无法使用
By
✿青歌◞
at 2017-12-12 • 0人收藏 • 5395人看过
location /.git { deny all; return 403; } location /controller { deny all; return 403; } location /docker_resources { deny all; return 403; } location /library { deny all; return 403; } location /service { deny all; return 403; } location /view { deny all; return 403; } location ~ /\.ht { deny all; return 403; } location / { try_files $uri $uri/ /index.php?$query_string; }
Github下载的最新版 nginx安装包里面提供的 用的宝塔控制面板
安装完了打开注册页面空白的
@admin
20 个回复 | 最后更新于 2017-12-12
回复#4 @lincanbin :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | server { listen 80; server_name www.kaxxx.com; index index.php index.html index.htm default.php default.htm default.html; root /www/wwwroot/wkhz/; #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则 #error_page 404/404.html; #SSL-END #ERROR-PAGE-START 错误页配置,可以注释、删除或修改 error_page 404 /404.html; error_page 502 /502.html; #ERROR-PAGE-END #PHP-INFO-START PHP引用配置,可以注释或修改 include enable-php-56.conf; #PHP-INFO-END #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效 include /www/server/panel/vhost/rewrite/www.kaiheizu.com.conf; #REWRITE-END #禁止访问的文件或目录 location ~ ^/(\.user.ini|\.htaccess|\.git|\.project|LICENSE|README.md) { return 404; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; access_log off; } location ~ .*\.(js|css)?$ { expires 12h; access_log off; } access_log /www/wwwlogs/www.kaixxxu.com.log; } |
我这边有一个引用伪静态的文件
是直接添加到这里还是添加到
1 | include /www/server/panel/vhost/rewrite/www.kaxxx.com.conf; |
回复#8 @lincanbin :
location /.git { deny all; return 403; } location /controller { deny all; return 403; } location /docker_resources { deny all; return 403; } location /library { deny all; return 403; } location /service { deny all; return 403; } location /view { deny all; return 403; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; return 403; } # rewrite location / { try_files $uri $uri/ /index.php?$query_string; }
这段话全部复制了也不行 我试了
回复#12 @lincanbin :
error_page 404 /404.php; location /.git { deny all; return 403; } location /controller { deny all; return 403; } location /docker_resources { deny all; return 403; } location /library { deny all; return 403; } location /service { deny all; return 403; } location /view { deny all; return 403; } location ~ /\.ht { deny all; return 403; } location / { try_files $uri $uri/ /index.php?$query_string; }
我全部复制的就是这个 是不是这个问题
登录后方可回帖
@lincanbin