jxxghp / MoviePilot-Frontend

MoviePilot前端
MIT License
177 stars 123 forks source link

设置反向代理后api无法访问 #155

Closed xiangt920 closed 2 months ago

xiangt920 commented 2 months ago

确认

当前程序版本

1.9.4-1

问题描述

在为MP设置反向代理后,此处的代码会导致api无法正常访问。 反向代理示例:

location /movie-pilot/ {
    proxy_pass http://service:7000;
    rewrite ^/movie-pilot(/.*)$ $1 break;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $http_host;
    proxy_read_timeout 86400;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

我的MP的api访问地址为https://xxx/movie-pilot/api,因此下面的正则表达式会匹配失败:

registerRoute(new NavigationRoute(createHandlerBoundToURL('index.html'), { denylist: [/^\/api/] }))

发生问题时系统日志和配置文件

No response