nginx切换https证书上线
发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,server { listen 80; rewrite ^(.*)$ https://$server_name$1 permanent;
千家信息网最后更新 2026年11月02日nginx切换https证书上线
server { listen 80; rewrite ^(.*)$ https://$server_name$1 permanent; server_name example.com; if ( "$host" != 'example.com' ){ rewrite ^/(.*)$ http://example.com/$1 permanent; } access_log logs/web.log main; location / { root web目录; index index.php index.html ; } location ~ \.php$ { root web目录; fastcgi_pass unix:/dev/shm/php-fpm.socket; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME web目录$fastcgi_script_name; include fastcgi_params; }}server { listen 443; ssl on; ssl_certificate /usr/local/data/nginx/conf/https.pem; ssl_certificate_key /usr/local/data/nginx/conf/https.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; access_log logs/access_web.log; location / { root web目录; index index.php index.html; } location ~ \.php$ { root web目录; fastcgi_pass unix:/dev/shm/php-fpm.socket; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME web目录$fastcgi_script_name; include fastcgi_params; }}注意
rewrite ^(.*)$ https://$server_name$1 permanent;
这里是强制重定向,去掉以后http和https 都能同时访问
目录
同时
强制
证书
切换
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
广州紫鲸互联网科技有限公司
新华互联网科技学校
深圳恒合互联网络科技有限公司
互联网科技与金融科技
互联网金融 科技金融
深圳互联网络科技有限公司
互联网 卓越科技
四川狮子座互联网科技
青海省互联网新科技
玖二柒互联网科技公司待遇
互联网系的金融科技公司
互联网大会黑科技排名
苏州五指互联网络科技有限
知域互联网科技有限公司大骗子
智帮互联网科技公司最近动向
广州千川互联网科技有限公司
卡尔迅互联网科技有限公司
科技互联网行业投资研究
互联网界的黑科技
西安左小互联网科技有限公司
小米移动互联网科技园
伟宏互联网科技
涨乐互联网科技
互联网巨头投资的硬核科技
996高科技互联网公司
用友工业互联网科技发展
滨湖区互联网智能科技产品有哪些
吉林省码上互联网科技电话
长沙易易互联网科技有限公司
前海云享互联网科技