VPS侦探论坛

 找回密码
 注册
查看: 2659|回复: 1

lnmp一键安装后访问项目除了首页没事,别的页面yang shi路...

[复制链接]
发表于 2020-4-1 15:58:48 | 显示全部楼层 |阅读模式

本帖最后由 xlnmp 于 2020-4-1 16:08 编辑

请大佬帮我看一下谢谢了;是什么问题呢?本地是没有问题的。
项目除首页外别的页面样式都多了两层,前台的话(home/控制器);
如:http://IP地址/Home/User/Public/home/css/myb-axc.css
正确的地址是:http://IP地址/Public/home/css/myb-axc.css


下斜线的是我加的;
      listen 80 default_server reuseport;
        #listen [::]:80 default_server ipv6only=on;
        server_name _;
        index index.php index.html index.htm;
        root  /var/www/novel;

        #include enable-php.conf;
        location / {
               # root    $root;
               # index   index.html index.php;
                if ( -f $request_filename) {
                        break;
                }
                if ( !-e $request_filename) {
                        rewrite ^/(.*)$ /index.php/$1 last;
                        break;
                }
        }
        location ~ [^/]\.php(/|$)
        {
            #try_files $uri =404;
            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
            include pathinfo.conf;
        }

        location /nginx_status
        {
            stub_status on;
            access_log   off;
        }

美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2020-4-1 18:12:05 | 显示全部楼层


已经解决,找到php.ini 修改cgi.fix_pathinfo=1 就可以了。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-21 19:29 , Processed in 0.025736 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表