编辑
2024-06-17
技术相关
00
请注意,本文编写于 311 天前,最后修改于 311 天前,其中某些信息可能已经过时。

目录

shop小店添加配置ssl证书

shop小店添加配置ssl证书

image.png

js
server { listen 80; server_name shop.iftballs.com; if ($host ~ "shop.iftballs.com$") { rewrite ^/(.)$ https://shop.iftballs.com/ permanent; } } server { listen 127.0.0.1:8452 ssl http2; server_name shop.iftballs.com; ssl_certificate '/www/server/panel/vhost/cert/shop.iftballs.com/fullchain.pem'; ssl_certificate_key '/www/server/panel/vhost/cert/shop.iftballs.com/privkey.pem'; ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; ssl_prefer_server_ciphers on; ssl_session_timeout '64m'; index index.php index.html index.htm default.php default.htm default.html; root /www/wwwroot/shop.iftballs.com; #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则 #error_page 404/404.html; #HTTP_TO_HTTPS_START if ($server_port !~ 8452){ rewrite ^(/.*)$ https://$host$1 permanent; } #HTTP_TO_HTTPS_END # 强制清除缓存(新增配置项) proxy_cache_purge on; #PHP-INFO-START PHP引用配置,可以注释或修改 include enable-php-74.conf; #PHP-INFO-END location ^~ / { proxy_pass http://127.0.0.1:56789; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header REMOTE-HOST $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; add_header X-Cache $upstream_cache_status; proxy_set_header Accept-Encoding ""; sub_filter "http://" "https://"; sub_filter_once off; } #禁止访问的文件或目录 location ~ ^/(.user.ini|.htaccess|.git|.svn|.project|LICENSE|README.md) { return 404; } access_log off; }

本文作者:Kevin@灼华

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!