您现在的位置是:首页>WebServer>NginxNginx
Nginx配置HTTP请求强制跳转到HTTPS
刘海林2021-10-25【Nginx】732人已围观
简介HTTP请求强制跳转到HTTPS
Nginx配置将 HTTP 请求强制跳转到 HTTPS 请求,只需在配置文件中添加如下配置即可:
if ($scheme = http) {
rewrite ^(.*)$ https://$host$1 permanent;
}
默认会将http请求重定向到https请求