Cloudreve icon indicating copy to clipboard operation
Cloudreve copied to clipboard

希望新增部署自定义子路径,方便nginx做子路径反代 Nginx with Subpath (example.org/cloudreve)

Open KWMaster opened this issue 10 months ago • 6 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] nginx要反代很多服务,如果只把域名根路径“/”全给cloudreve服务,其他服务子路径比如example.org/jellyfin在清空网站缓存的前提下,直接访问example.org/jellyfin是可以正常访问的,但是一旦同时打开根路径example.org/的cloudreve服务,之后所有路径都会全部导向cloudreve服务 When configuring nginx to reverse proxy multiple services, if you only pass the root path "/" to the cloudreve service and leave other service paths like example.org/jellyfin untouched, accessing example.org/jellyfin directly should work fine after clearing the website cache. However, once you also open the root path example.org/ for the cloudreve service, all subsequent paths will be redirected to the cloudreve service.

Describe the solution you'd like A clear and concise description of what you want to happen. 希望能增加cloudreve部署的子路径自定义设置,支持本机压缩包部署、docker部署的子路径配置 I suggest adding customizable sub-path settings for deploying Cloudreve, supporting sub-path configurations for both local compressed package deployment and Docker deployment.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. 同时希望在使用文档中增加nginx子路径反代配置示例 I also recommend including examples of nginx sub-path reverse proxy configurations in the usage documentation.

Additional context Add any other context or screenshots about the feature request here. 类似jellyfin的子路径官方使用文档示例 Similar to the official documentation examples for sub-path configuration of services like Jellyfin. image

KWMaster avatar Apr 05 '24 05:04 KWMaster

强烈需要这个功能,我折腾了好久没有弄成

zzti avatar May 12 '24 08:05 zzti

我也在nginx中配置了子路径,但是运行后打开是空白。

shifaming avatar Jul 01 '24 08:07 shifaming

试试监听不同域名呢

duzhuoshanwai avatar Jul 01 '24 09:07 duzhuoshanwai

监听不同的域名是可以的。但是这就意味着需要独占一个域名。如果能代理子路径最好。

shifaming avatar Jul 02 '24 10:07 shifaming

做了一版,还有问题 感觉是服务端渲染代码导致的。有的页面元素点击会改变地址栏的url地址,这个没有发起请求,没办法在nginx端做到代理 浏览器端的动态页面仅仅通过http server的转发没办法完美解决

图片

location ~* /(static|api|locales) {
      proxy_pass http://127.0.0.1:5212;
}

location ~* ^/reve/(.*)$ {
    proxy_pass http://127.0.0.1:5212/$1$is_args$args;
    proxy_intercept_errors on;

    error_page 302 =200 @handle_redirect;
}

location @handle_redirect {
    set $saved_redirect_location '$upstream_http_location';
    proxy_pass $saved_redirect_location;
}

wnpllrzodiac avatar Aug 01 '24 09:08 wnpllrzodiac

Related: #1129

topjohncian avatar Aug 01 '24 11:08 topjohncian