NGINX强制使用https访问(http跳转到https)代码作者: ky818sm / 2023年11月10日 / Linux 21 server { listen 80; server_name example.com; // 替换为你的域名 # HTTP重定向到HTTPS rewrite ^(.*)$ https://$host$1 permanent; }