yisier / nps

在 0.26.10 版本的基础上修改而来的
https://ehang.io/nps/documents
GNU General Public License v3.0
1.84k stars 223 forks source link

使用域名解析,直接访问域名不加任何路径,会莫名代理到Portainer的9000端口 #119

Closed seepine closed 9 months ago

seepine commented 10 months ago

Describe the bug

使用域名解析,直接访问域名不加任何路径,会莫名代理到Portainer的9000端口

To Reproduce

云服务器通过docker部署最新版本nps

version: '3'
services:
  server:
    image: yisier1/nps
    ports:
      - 18080:8080
      - 10080:80
      - 18024:8024

进入管理后台配置域名解析

a.com 转发到一台内网服务器 192.168.3.10:9000

云服务器nginx配置转发

server
{
    listen 80;
    listen 443 ssl http2;
    server_name a.com;
    index index.php index.html index.htm default.php default.htm default.html;

    location / {
       proxy_set_header Host $http_host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_pass http://127.0.0.1:10080/;

       if ($request_method = 'OPTIONS') {
         return 204;
       }
    }
}

错误情况:直接访问域名 https://a.com

预期情况:当访问域名+路径

例如 https://a.com/xhttps://a.com/login ,才能成功转发到内网应用上,出现404或对应页面

Expected behavior A clear and concise description of what you expected to happen.

Screenshots or logs image

Server (please complete the following information):

Client (please complete the following information):

seepine commented 10 months ago

貌似和个数或时间有关系?我一开始添加的早上添加了两个,没有这个问题,后面加到了五个,下午再访问就出现这个情况