Nginx服务器无法实现伪静态化,在后台设置不成功
错误提示:
Nginx服务器无法实现伪静态化,在后台设置不成功
解决方案:
这主要是nginx的rewrite没有设置导致的
在nginx.conf里找到网站的server配置段,一般我们推荐如下的配置
server {
listen 80;
server_name yourdomain.com;
root /home/yourdomain/www/;
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
location ~ .*\.php(\/.*)*$ {
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
}
access_log logs/yourdomain.log combined;
}
注意把以上配置中的yourdomain换成你自己的实际域名和实际目录存放地址
扫码添加技术【解决问题】
专注企业网站建设、网站安全16年。
承接:企业网站建设、网站修改、网站改版、BUG修复、问题处理、二次开发、PSD转HTML、网站被黑、网站漏洞修复等。
专业解决各种疑难杂症,您有任何网站问题都可联系我们技术人员。
本文来自博客园,作者:黄文Rex,转载请注明原文链接:https://www.cnblogs.com/hwrex/p/18325814