本帖最后由 sliver 于 2022-9-30 22:20 编辑
不懂,只知道 nginx 写 rewrite 能用
打开 http://probe.iliy.net 会自动跳 https://probe.iliy.net
-
- server {
- listen 80;
- listen [::]:80;
- server_name probe.iliy.net;
- rewrite ^(.*) https://$server_name$1 permanent;
- access_log off;
- }
- server {
- listen 443;
- listen [::]:443;
- server_name probe.iliy.net;
- ssl_certificate /etc/letsencrypt/live/iliy.net/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/iliy.net/privkey.pem;
- location / {
- proxy_pass http://0.0.0.0:44444;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded_For $proxy_add_x_forwarded_for;
- }
- access_log off;
- }
复制代码
|