xizeyoupan / Meting-API

🐳 Meting API 的容器化与部署
https://meting-dd.2333332.xyz
209 stars 208 forks source link

Docker部署成功后路径是http #30

Closed junyangfan closed 4 months ago

junyangfan commented 4 months ago

用Docker的方式部署,并且nginx已经开启了https(如果是http,则重定向到https)访问服务,里面仍然是http路径 部署地址:https://api-meting.fjy.zone 1

xizeyoupan commented 4 months ago

贴下nginx配置

junyangfan commented 4 months ago

贴下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;
}
xizeyoupan commented 4 months ago

看reamde,加上proxy_set_header X-Forwarded-Host $scheme://$host:$server_port;

junyangfan commented 4 months ago

看reamde,加上proxy_set_header X-Forwarded-Host $scheme://$host:$server_port;

好的,谢谢,确实是这个问题