Closed junyangfan closed 4 months ago
贴下nginx配置
贴下nginx配置
用的是 nginx proxy manager 配置的,应该就是个简单的反代,不需要特殊配置吗?我看其他issues需要设置 header,是这个原因吗
map $scheme $hsts_header {
https "max-age=63072000; preload";
}
server {
set $forward_scheme http;
set $server "127.0.0.1";
set $port 4300;
listen 80;
#listen [::]:80;
listen 443 ssl;
#listen [::]:443;
server_name api-meting.fjy.zone;
# Let's Encrypt SSL
include conf.d/include/letsencrypt-acme-challenge.conf;
include conf.d/include/ssl-ciphers.conf;
ssl_certificate /etc/letsencrypt/live/npm-1/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/npm-1/privkey.pem;
# Block Exploits
include conf.d/include/block-exploits.conf
# Force SSL
include conf.d/include/force-ssl.conf;
location / {
# Proxy!
include conf.d/include/proxy.conf;
}
# Custom
include /data/nginx/custom/server_proxy[.]conf;
}
看reamde,加上proxy_set_header X-Forwarded-Host $scheme://$host:$server_port;
看reamde,加上
proxy_set_header X-Forwarded-Host $scheme://$host:$server_port;
好的,谢谢,确实是这个问题
用Docker的方式部署,并且nginx已经开启了https(如果是http,则重定向到https)访问服务,里面仍然是http路径 部署地址:https://api-meting.fjy.zone