mirror of
https://github.com/YunoHost-Apps/transmission_ynh.git
synced 2024-09-04 01:46:12 +02:00
Félix Piédallu
6d8a73930d
We need to do that *only* on the RPC location to keep redirect to SSO working.
45 lines
1.1 KiB
Nginx Configuration File
45 lines
1.1 KiB
Nginx Configuration File
location __PATH__/transmission/rpc {
|
|
proxy_pass http://127.0.0.1:__PORT____PATH__/transmission/rpc;
|
|
more_clear_input_headers 'Accept-Encoding';
|
|
|
|
client_max_body_size 8M;
|
|
|
|
# This is a fix up for RPC login. Client is either a browser
|
|
# (SSOwAuthUser cookie) or a transmission-remote client (Basic Auth)
|
|
# If none is present, return a 401.
|
|
set $rpcauth 0;
|
|
if ($http_authorization ~ "Basic .*") {
|
|
set $rpcauth 1;
|
|
}
|
|
if ($cookie_SSOwAuthUser != "") {
|
|
set $rpcauth 1;
|
|
}
|
|
if ($rpcauth = 0) {
|
|
more_set_headers "WWW-Authenticate: Basic";
|
|
return 401;
|
|
}
|
|
|
|
# Include SSOWAT user panel.
|
|
include conf.d/yunohost_panel.conf.inc;
|
|
}
|
|
|
|
location __PATH__/ {
|
|
proxy_pass http://127.0.0.1:__PORT____PATH__/;
|
|
more_clear_input_headers 'Accept-Encoding';
|
|
|
|
client_max_body_size 8M;
|
|
|
|
# Include SSOWAT user panel.
|
|
include conf.d/yunohost_panel.conf.inc;
|
|
}
|
|
|
|
location __PATH__/downloads/ {
|
|
alias __DATA_DIR__/completed/;
|
|
charset UTF-8;
|
|
autoindex on;
|
|
autoindex_exact_size off;
|
|
more_clear_input_headers 'Accept-Encoding';
|
|
|
|
# Include SSOWAT user panel.
|
|
include conf.d/yunohost_panel.conf.inc;
|
|
}
|