| ... | ... | @@ -101,7 +101,51 @@ import ./jellyfin/Caddyfile |
| 101 | 101 | # 	} |
| 102 | 102 | # } |
| 103 | 103 | music.{$HOME_DOMAIN} { |
| 104 | | 	reverse_proxy "http://navidrome:4533" |
| 104 | 	handle_path /app/sw.js { |
| 105 | header Content-Type "application/javascript" |
| 106 | 		respond "// sw disabled" 200 |
| 107 | 	} |
| 108 | |
| 109 | 	handle /snow.oauth2/* { |
| 110 | 		reverse_proxy "http://forward-auth" { |
| 111 | 			header_up X-Real-IP {remote_host} |
| 112 | 			header_up X-Forwarded-Uri {uri} |
| 113 | 		} |
| 114 | 	} |
| 115 | |
| 116 | @protected not path /share/* /rest/* /snow.oauth2/* /app/sw.js |
| 117 | forward_auth @protected "http://forward-auth" { |
| 118 | uri /snow.oauth2/auth |
| 119 | header_up X-Real-IP {remote_host} |
| 120 | copy_headers X-Auth-Request-Preferred-Username>Remote-User |
| 121 | @error status 401 |
| 122 | handle_response @error { |
| 123 | redir * /snow.oauth2/sign_in?rd={scheme}://{host}{uri} |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | @subsonic path /rest/* |
| 128 | forward_auth @subsonic "http://forward-auth" { |
| 129 | uri /snow.oauth2/auth |
| 130 | header_up X-Real-IP {remote_host} |
| 131 | copy_headers X-Auth-Request-Preferred-Username>Remote-User |
| 132 | |
| 133 | # Some clients that claim to support basicauth still expect a subsonic |
| 134 | # response in case of authentication failure instead of a proper basicauth |
| 135 | # response. |
| 136 | @error status 1xx 3xx 4xx 5xx |
| 137 | handle_response @error { |
| 138 | respond <<SUBSONICERR |
| 139 | <subsonic-response xmlns="http://subsonic.org/restapi" status="failed" version="1.16.1" type="proxy-auth" serverVersion="n/a" openSubsonic="true"> |
| 140 | <error code="40" message="Invalid credentials or unsupported client"></error> |
| 141 | </subsonic-response> |
| 142 | SUBSONICERR 200 |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | handle { |
| 147 | reverse_proxy "http://navidrome" |
| 148 | } |
| 105 | 149 | } |
| 106 | 150 | # opencode.{$HOME_DOMAIN} { |
| 107 | 151 | # 	import auth |