Python---Web服务器(Nginx)

Nginx配置文件:nginx.conf文件

http {
    server{
        listen 80;                      # 监听的端口:80,可以修改。
        listen 443 ssl;                 # 或者:listen 443 ssl http2;
        server_name xcx.test.com;       # 定义使用xcx.test.com访问,即浏览器输入的地址。
        index index.php index.html index.htm default.php default.htm default.html;
        root /www/wwwroot/xcx.zun.com;

        #SSL-START SSL的相关配置,请勿删除或修改下一行带注释的404规则。
        #error_page 404/404.html;
        ssl_certificate    /www/server/panel/vhost/cert/xcx.test.com/fullchain.pem;
        ssl_certificate_key    /www/server/panel/vhost/cert/xcx.test.com/privkey.pem;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
        ssl_prefer_server_ciphers on;
        ssl_session_cache shared:SSL:10m;
        ssl_session_timeout 10m;
        error_page 497  https://$host$request_uri;
        #SSL-END

        # 想在HTML里插入PHP代码,然后直接访问HTML文件,执行里面的PHP代码。让html文件也作为PHP文件解析执行。每次执行html文件 会执行里面的php代码后并返回。
        # 配置完之后还需要编辑php的配置文件(php-fpm.conf文件),指定html扩展名:security.limit_extensions = .php .php3 .php4 .php5 .html .png .htm  
        # 从5.3.9开始,php官方加入了一个配置"security.limit_extensions",默认状态下只允许执行扩展名为".php"的文件,造成了其他类型的文件不支持的问题。
        location ~ \.php|\.html$ {  
    	    root /www/wwwroot/haidon.top;
            # fastcgi_pass 127.0.0.1:9000; 
            fastcgi_pass  unix:/tmp/php-cgi-56.sock;  
            fastcgi_param SCRIPT_FILENAME /www/wwwroot/haidon.top$fastcgi_script_name;     
            fastcgi_index index.html;                                           
            include fastcgi_params; 
            expires 7d;
        }                                                       
    }
}

# 提醒:要放行需要使用的端口:例如80和443。

https://blog.csdn.net/ljfphp/article/details/78474152

https://blog.csdn.net/u012557538/article/details/77247867 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值