纳菲力姆 2021-09-15 13:13
浏览 71
已结题

用nginx反代transmission的webui端口后无法访问

我在自己的Nas上装了一个transmission用来下电影。用的Docker装的,运行良好。
这个transmission有个WebUI的界面用来远程管理,占用9091端口,只能以http来访问,不支持https。
所以我又装了一个swag到Nas里,也是Docker安装。
想配置一个反向代理来实现https访问transmission的界面。swag提供了很多软件的反向代理模板,支持两种地址形式。
可以把原地址为http://www.abc.com:9091/transmission/web/ 改为transmission.abc.com或者www.abc.com/transmission
我将模板安装到了指定的目录后发现不起作用。我还是访问不了。
查记录发现出来一行报错
nginx: [emerg] "location" directive is not allowed here in /config/nginx/site-confs/transmission.subfolder.conf:14

transmission.subfolder.conf配置文件如下:

## Version 2021/05/18
# Transmission does not require a base url setting
#
# Some Transmission Chrome extensions cannot handle HTTP/2 proxies as they
# rely on the HTTP Status Text to determine if they should add the
# X-Transmission-Session-Id header or not. HTTP/2 does not return this text
# so jQuery responses are empty. This causes RPCs to fail.
#
# If your extension is affected, you can remove http2 from the default server
# in /config/nginx/site-confs/default or listen on a different port that has
# no http2 servers defined. Better yet, submit a bug report with the
# extension developer to fix their extensions to support HTTP/2.

location ^~ /transmission {
    # enable the next two lines for http auth
    #auth_basic "Restricted";
    #auth_basic_user_file /config/nginx/.htpasswd;

    # enable the next two lines for ldap auth, also customize and enable ldap.conf in the default conf
    #auth_request /auth;
    #error_page 401 =200 /ldaplogin;

    # enable for Authelia, also enable authelia-server.conf in the default site config
    #include /config/nginx/authelia-location.conf;

    include /config/nginx/proxy.conf;
    include /config/nginx/resolver.conf;
    set $upstream_app transmission;
    set $upstream_port 9091;
    set $upstream_proto http;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    proxy_pass_header  X-Transmission-Session-Id;
}

location ^~ /transmission/rpc {
    include /config/nginx/proxy.conf;
    include /config/nginx/resolver.conf;
    set $upstream_app transmission;
    set $upstream_port 9091;
    set $upstream_proto http;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;

}


  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 系统已结题 9月23日
    • 修改了问题 9月15日
    • 创建了问题 9月15日

    悬赏问题

    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
    • ¥50 成都蓉城足球俱乐部小程序抢票
    • ¥15 yolov7训练自己的数据集
    • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
    • ¥15 电力市场出清matlab yalmip kkt 双层优化问题