2018-07-16 15:23:55 2289次浏览 2条回答 0 悬赏 30 金钱

环境lnmp
代码在http 可以正常访问
当配置了https 之后显示404
已检测https 访问phpinfo可以 但是直接访问原来项目却404
请问要修改哪里

最佳答案

  • ╃巡洋艦㊣ 发布于 2018-07-16 16:26 举报

    这是本站的 nginx.conf 配置文件

    server {
        listen       443 ssl;
        listen       80;
        server_name  www.xxx.com;
    
        ssl_certificate   cert/xxxx.pem;
        ssl_certificate_key  cert/xxxx.key;
        ssl_session_timeout 5m;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        root         /path/to/web;
        index        index.php;
    
        location / {
            # Redirect everything that isn't a real file to index.php
            try_files $uri $uri/ /index.php$is_args$args;
        }
    
        location ~ \.php$ {
            include        fastcgi_params;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        }
    
        location ~ /\.(ht|svn|git) {
            deny all;
        }
    }
    
    1 条回复
    回复于 2018-07-17 09:06 回复

    谢谢舰长 我这边看你的懂了 我把http的配置删了就好了

  • 回答于 2018-07-16 16:39 举报

    把配置贴出来看看

    1 条回复
    回复于 2018-07-17 09:04 回复

    是自动生成的配置 lnmp一键安装之后 然后执行 lnmp ssl add生成的 我已经解决了 谢谢

您需要登录后才可以回答。登录 | 立即注册
郝立国
总监

郝立国

注册时间:2017-02-09
最后登录:2024-01-11
在线时长:77小时3分
  • 粉丝6
  • 金钱2925
  • 威望110
  • 积分4795

热门问题