Nginx配置HTTPS并解析PHP脚本报错问题解决方法

配置443端口访问时发现一次处于文件下载状态,后来发现竟然是443端口下的服务无法解析php文件,后发现location ~ .php$ 下面写然后转给fast-cgi解析

在这里插入图片描述

 server {
        listen       443 ssl;
        server_name  www.liuyuanshan.top;

        ssl_certificate      cert/liuyuanshan.top.pem;
        ssl_certificate_key  cert/liuyuanshan.top.key;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;

       # location / {
            root   html/bbs;
           index  index.php index.html index.htm;
       # }

        location ~ \.php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include        fastcgi_params;
        }
    }
发布了40 篇原创文章 · 获赞 0 · 访问量 647

猜你喜欢

转载自blog.csdn.net/weixin_39218464/article/details/104083631