设为首页
收藏本站
切换到宽版
用户名
Email
自动登录
找回密码
密码
登录
注册
快捷导航
论坛
BBS
排行榜
Ranklist
搜索
搜索
热搜:
香港vps
香港VPS
amh
机柜
vps
分销
VPS
域名出售
火车头
云主机
不限流量
香港服务器
美国服务器
香港
全能空间
whmcs
digitalocean
本版
帖子
用户
MJJ论坛
»
论坛
›
技术交流分享
›
Web技术
›
如何让http自动跳转到https
1
2
/ 2 页
返回列表
楼主:
天蚕土豆
如何让http自动跳转到https
[复制链接]
Giine
Giine
当前离线
积分
5048
发表于 2018-3-17 15:48:36
|
显示全部楼层
server {
server_name gov.cn;
listen 443 ssl http2;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_certificate /etc/letsencrypt/live/gov.cn/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/gov.cn/privkey.pem; # managed by Certbot
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 60m;
ssl_session_tickets on;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.4.4 8.8.8.8 valid=300s;
resolver_timeout 10s;
root /var/www/gov/public;
index index.html index.php index.htm;
location / {
try_files $uri $uri/ /index.php?$args;
}
client_max_body_size 4m;
access_log /var/log/nginx/elsenow.log;
error_log /var/log/nginx/error.elsenow.log;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 80;
server_name gov.cn www.gov.cn;
location / {
rewrite ^/(.*)$ https://gov.cn/$1 permanent;
}
}
复制代码
回复
支持
反对
举报
1
2
/ 2 页
返回列表
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
注册
本版积分规则
发表回复
回帖后跳转到最后一页
浏览过的版块
域名注册续费交流
Offers专区
Archiver
|
手机版
|
小黑屋
|
MJJ论坛
Copyright
MJJ论坛
© 2022 All Rights Reserved.
快速回复
返回顶部
返回列表