Reverse proxy doesn't work when basic authentication is enabled

1. Caddy version (caddy version):

2.5.2

2. How I run Caddy:

I run it as a Docker image on a QNAP NAS. I have a config directory and a data directory mounted, per the instructions here: Docker Hub

a. System environment:

QNAP Container Station (docker)

b. Command:

Per Container Station, it’s:

caddy run --config /etc/caddy/Caddyfile --adapter caddyfile

c. Service/unit/compose file:

Handled by Container Station; I don’t see it.

d. My complete Caddyfile or JSON config:

tfprometheus.myvnc.com

handle_path /modixcam/* {
	reverse_proxy 192.168.1.39:81
}

handle /* {
    reverse_proxy 192.168.1.123:80
}

{
    debug
}

log {
	output file /data/access.log
}

basicauth {
	username passwordhash
}

3. The problem I’m having:

I’m trying to put Klipper, specifically Mainsail, behind a reverse proxy and secure it with basic authentication. (These are apps related to 3D printing.) Both paths above work without basic authentication, and the modixcam path works with it. (The modixcam path is just a simple MJPEG video stream, while the default path is a fancy web app.) But the default path loads the web app, but then can’t access the other data it needs to run the app. Looking at the logs, I’m guessing my authentication isn’t being passed along? I don’t know how to make that happen…

4. Error messages and/or full log output:

The app loads, but then it can’t connect to its various components.

2022/07/16 05:35:31.973	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/", "headers": {"Accept-Language": ["en-US,en;q=0.9"], "Pragma": ["no-cache"], "Sec-Fetch-Mode": ["navigate"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Sec-Fetch-Site": ["none"], "Sec-Fetch-User": ["?1"], "Cache-Control": ["no-cache"], "Sec-Ch-Ua-Mobile": ["?0"], "Sec-Fetch-Dest": ["document"], "Accept-Encoding": ["gzip, deflate, br"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Upgrade-Insecure-Requests": ["1"], "Accept": ["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.000070678, "size": 0, "status": 401, "resp_headers": {"Server": ["Caddy"], "Www-Authenticate": ["Basic realm=\"restricted\""]}}
2022/07/16 05:35:35.634	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/", "headers": {"Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Fetch-Dest": ["document"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept": ["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"], "Sec-Fetch-Site": ["none"], "Cache-Control": ["max-age=0"], "Sec-Ch-Ua-Mobile": ["?0"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Sec-Fetch-User": ["?1"], "Accept-Language": ["en-US,en;q=0.9"], "Accept-Encoding": ["gzip, deflate, br"], "Authorization": [], "Upgrade-Insecure-Requests": ["1"], "Sec-Fetch-Mode": ["navigate"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "username", "duration": 0.27912027, "size": 714, "status": 200, "resp_headers": {"Cache-Control": ["no-store, no-cache, must-revalidate"], "Date": ["Sat, 16 Jul 2022 05:35:52 GMT"], "Content-Type": ["text/html"], "Etag": ["W/\"62c6447b-725\""], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Vary": ["Accept-Encoding"], "Content-Encoding": ["gzip"], "Server": ["Caddy", "nginx/1.14.2"]}}
2022/07/16 05:35:35.747	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/assets/vendor.4ee48f24.css", "headers": {"Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Ch-Ua-Mobile": ["?0"], "Accept": ["text/css,*/*;q=0.1"], "Sec-Fetch-Mode": ["no-cors"], "Sec-Fetch-Dest": ["style"], "Referer": ["https://tfprometheus.myvnc.com/"], "Accept-Language": ["en-US,en;q=0.9"], "Authorization": [], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Sec-Fetch-Site": ["same-origin"], "Accept-Encoding": ["gzip, deflate, br"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "username", "duration": 0.058943709, "size": 71853, "status": 200, "resp_headers": {"Content-Encoding": ["gzip"], "Date": ["Sat, 16 Jul 2022 05:35:52 GMT"], "Content-Type": ["text/css"], "Server": ["Caddy", "nginx/1.14.2"], "Vary": ["Accept-Encoding"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Etag": ["W/\"62c6447b-812d4\""]}}
2022/07/16 05:35:35.863	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/assets/index.f5d6ee22.js", "headers": {"Authorization": [], "Referer": ["https://tfprometheus.myvnc.com/"], "Accept-Encoding": ["gzip, deflate, br"], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Mode": ["cors"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Ch-Ua-Mobile": ["?0"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["*/*"], "Sec-Fetch-Dest": ["script"], "Accept-Language": ["en-US,en;q=0.9"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "username", "duration": 0.174675343, "size": 350174, "status": 200, "resp_headers": {"Content-Type": ["application/javascript"], "Date": ["Sat, 16 Jul 2022 05:35:52 GMT"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Vary": ["Accept-Encoding"], "Etag": ["W/\"62c6447b-160564\""], "Content-Encoding": ["gzip"], "Server": ["Caddy", "nginx/1.14.2"]}}
2022/07/16 05:35:35.864	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/assets/index.f7b571b2.css", "headers": {"Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["text/css,*/*;q=0.1"], "Sec-Fetch-Dest": ["style"], "Accept-Language": ["en-US,en;q=0.9"], "Accept-Encoding": ["gzip, deflate, br"], "Authorization": [], "Sec-Ch-Ua-Mobile": ["?0"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Mode": ["no-cors"], "Referer": ["https://tfprometheus.myvnc.com/"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "username", "duration": 0.176165715, "size": 11273, "status": 200, "resp_headers": {"Vary": ["Accept-Encoding"], "Etag": ["W/\"62c6447b-b3af\""], "Content-Encoding": ["gzip"], "Server": ["Caddy", "nginx/1.14.2"], "Date": ["Sat, 16 Jul 2022 05:35:52 GMT"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Content-Type": ["text/css"]}}
2022/07/16 05:35:35.890	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/assets/vendor.60e31b64.js", "headers": {"Sec-Fetch-Dest": ["script"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Ch-Ua-Mobile": ["?0"], "Accept": ["*/*"], "Sec-Fetch-Mode": ["cors"], "Accept-Language": ["en-US,en;q=0.9"], "Accept-Encoding": ["gzip, deflate, br"], "Authorization": [], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Sec-Fetch-Site": ["same-origin"], "Referer": ["https://tfprometheus.myvnc.com/"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "username", "duration": 0.202351711, "size": 555970, "status": 200, "resp_headers": {"Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Vary": ["Accept-Encoding"], "Etag": ["W/\"62c6447b-1ab72e\""], "Content-Encoding": ["gzip"], "Server": ["Caddy", "nginx/1.14.2"], "Date": ["Sat, 16 Jul 2022 05:35:52 GMT"], "Content-Type": ["application/javascript"]}}
2022/07/16 05:35:36.212	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/img/icons/favicon-32x32.png", "headers": {"Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Dest": ["image"], "Authorization": [], "Accept": ["image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"], "Sec-Fetch-Mode": ["no-cors"], "Referer": ["https://tfprometheus.myvnc.com/"], "Accept-Language": ["en-US,en;q=0.9"], "Accept-Encoding": ["gzip, deflate, br"], "Sec-Ch-Ua-Mobile": ["?0"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "username", "duration": 0.006811795, "size": 618, "status": 200, "resp_headers": {"Content-Type": ["image/png"], "Server": ["Caddy", "nginx/1.14.2"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Content-Length": ["618"], "Etag": ["\"62c6447b-26a\""], "Accept-Ranges": ["bytes"], "Date": ["Sat, 16 Jul 2022 05:35:52 GMT"]}}
2022/07/16 05:35:36.247	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57183", "proto": "HTTP/1.1", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/websocket", "headers": {"Cache-Control": ["no-cache"], "Authorization": [], "Origin": ["https://tfprometheus.myvnc.com"], "Accept-Encoding": ["gzip, deflate, br"], "Connection": ["Upgrade"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept-Language": ["en-US,en;q=0.9"], "Sec-Websocket-Key": ["tW7kBteffYv7hU308sY10A=="], "Sec-Websocket-Extensions": ["permessage-deflate; client_max_window_bits"], "Pragma": ["no-cache"], "Sec-Websocket-Version": ["13"], "Upgrade": ["websocket"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "http/1.1", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "username", "duration": 0.014625724, "size": 75, "status": 401, "resp_headers": {"Date": ["Sat, 16 Jul 2022 05:35:52 GMT"], "Content-Type": ["text/html; charset=UTF-8"], "Server": ["Caddy", "nginx/1.14.2"], "Content-Length": ["75"]}}
2022/07/16 05:35:36.388	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/fonts/roboto-bold.woff2", "headers": {"Sec-Fetch-Dest": ["font"], "Accept-Encoding": ["gzip, deflate, br"], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Ch-Ua-Mobile": ["?0"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Fetch-Site": ["same-origin"], "Referer": ["https://tfprometheus.myvnc.com/assets/index.f7b571b2.css"], "Accept-Language": ["en-US,en;q=0.9"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["*/*"], "Sec-Fetch-Mode": ["cors"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.000051167, "size": 0, "status": 401, "resp_headers": {"Server": ["Caddy"], "Www-Authenticate": ["Basic realm=\"restricted\""]}}
2022/07/16 05:35:36.389	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/img/sidebar-background.svg", "headers": {"Sec-Fetch-Dest": ["image"], "Referer": ["https://tfprometheus.myvnc.com/"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Ch-Ua-Mobile": ["?0"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Mode": ["no-cors"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept-Language": ["en-US,en;q=0.9"], "Accept-Encoding": ["gzip, deflate, br"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.000027103, "size": 0, "status": 401, "resp_headers": {"Www-Authenticate": ["Basic realm=\"restricted\""], "Server": ["Caddy"]}}
2022/07/16 05:35:36.389	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/fonts/roboto-regular.woff2", "headers": {"Accept-Encoding": ["gzip, deflate, br"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["*/*"], "Sec-Fetch-Dest": ["font"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Mode": ["cors"], "Referer": ["https://tfprometheus.myvnc.com/assets/index.f7b571b2.css"], "Accept-Language": ["en-US,en;q=0.9"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Ch-Ua-Mobile": ["?0"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.000020509, "size": 0, "status": 401, "resp_headers": {"Server": ["Caddy"], "Www-Authenticate": ["Basic realm=\"restricted\""]}}
2022/07/16 05:35:36.389	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/fonts/roboto-medium.woff2", "headers": {"Sec-Ch-Ua-Mobile": ["?0"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["*/*"], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Dest": ["font"], "Referer": ["https://tfprometheus.myvnc.com/assets/index.f7b571b2.css"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Fetch-Mode": ["cors"], "Accept-Language": ["en-US,en;q=0.9"], "Accept-Encoding": ["gzip, deflate, br"], "Origin": ["https://tfprometheus.myvnc.com"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.00003005, "size": 0, "status": 401, "resp_headers": {"Server": ["Caddy"], "Www-Authenticate": ["Basic realm=\"restricted\""]}}
2022/07/16 05:35:37.397	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57192", "proto": "HTTP/1.1", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/websocket", "headers": {"User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept-Encoding": ["gzip, deflate, br"], "Sec-Websocket-Key": ["Zd8amMfOilUPZDtwShD/1A=="], "Sec-Websocket-Extensions": ["permessage-deflate; client_max_window_bits"], "Connection": ["Upgrade"], "Pragma": ["no-cache"], "Cache-Control": ["no-cache"], "Upgrade": ["websocket"], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Websocket-Version": ["13"], "Accept-Language": ["en-US,en;q=0.9"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "http/1.1", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.000051229, "size": 0, "status": 401, "resp_headers": {"Server": ["Caddy"], "Www-Authenticate": ["Basic realm=\"restricted\""]}}
2022/07/16 05:35:38.416	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57197", "proto": "HTTP/1.1", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/websocket", "headers": {"Cache-Control": ["no-cache"], "Upgrade": ["websocket"], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Websocket-Version": ["13"], "Accept-Encoding": ["gzip, deflate, br"], "Sec-Websocket-Key": ["3aJ4KsVVJoIOaNhs2MIf+Q=="], "Sec-Websocket-Extensions": ["permessage-deflate; client_max_window_bits"], "Connection": ["Upgrade"], "Pragma": ["no-cache"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept-Language": ["en-US,en;q=0.9"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "http/1.1", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.000045623, "size": 0, "status": 401, "resp_headers": {"Server": ["Caddy"], "Www-Authenticate": ["Basic realm=\"restricted\""]}}
2022/07/16 05:35:39.430	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57202", "proto": "HTTP/1.1", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/websocket", "headers": {"Pragma": ["no-cache"], "Cache-Control": ["no-cache"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept-Language": ["en-US,en;q=0.9"], "Sec-Websocket-Extensions": ["permessage-deflate; client_max_window_bits"], "Connection": ["Upgrade"], "Sec-Websocket-Version": ["13"], "Accept-Encoding": ["gzip, deflate, br"], "Sec-Websocket-Key": ["CFIuXzEt8r8nc/vI8n4z7w=="], "Upgrade": ["websocket"], "Origin": ["https://tfprometheus.myvnc.com"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "http/1.1", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.000053205, "size": 0, "status": 401, "resp_headers": {"Server": ["Caddy"], "Www-Authenticate": ["Basic realm=\"restricted\""]}}
2022/07/16 05:35:40.454	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57206", "proto": "HTTP/1.1", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/websocket", "headers": {"User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Upgrade": ["websocket"], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Websocket-Version": ["13"], "Sec-Websocket-Key": ["XNSklXTKJr885JUUblS6jw=="], "Connection": ["Upgrade"], "Pragma": ["no-cache"], "Cache-Control": ["no-cache"], "Accept-Encoding": ["gzip, deflate, br"], "Accept-Language": ["en-US,en;q=0.9"], "Sec-Websocket-Extensions": ["permessage-deflate; client_max_window_bits"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "http/1.1", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.000051954, "size": 0, "status": 401, "resp_headers": {"Server": ["Caddy"], "Www-Authenticate": ["Basic realm=\"restricted\""]}}
2022/07/16 05:35:40.972	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/fonts/roboto-medium.woff2", "headers": {"Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Mode": ["cors"], "Sec-Fetch-Dest": ["font"], "Accept-Encoding": ["gzip, deflate, br"], "Origin": ["https://tfprometheus.myvnc.com"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["*/*"], "Accept-Language": ["en-US,en;q=0.9"], "Authorization": [], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Ch-Ua-Mobile": ["?0"], "Referer": ["https://tfprometheus.myvnc.com/assets/index.f7b571b2.css"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "username", "duration": 0.004765373, "size": 11056, "status": 200, "resp_headers": {"Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Date": ["Sat, 16 Jul 2022 05:35:57 GMT"], "Content-Length": ["11056"], "Etag": ["\"62c6447b-2b30\""], "Server": ["Caddy", "nginx/1.14.2"], "Accept-Ranges": ["bytes"], "Content-Type": ["application/octet-stream"]}}
2022/07/16 05:35:40.972	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/img/sidebar-background.svg", "headers": {"Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Ch-Ua-Mobile": ["?0"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Dest": ["image"], "Referer": ["https://tfprometheus.myvnc.com/"], "Accept-Language": ["en-US,en;q=0.9"], "Authorization": [], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept": ["image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"], "Sec-Fetch-Mode": ["no-cors"], "Accept-Encoding": ["gzip, deflate, br"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "username", "duration": 0.00529248, "size": 2669, "status": 200, "resp_headers": {"Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Accept-Ranges": ["bytes"], "Date": ["Sat, 16 Jul 2022 05:35:57 GMT"], "Content-Type": ["image/svg+xml"], "Content-Length": ["2669"], "Etag": ["\"62c6447b-a6d\""], "Server": ["Caddy", "nginx/1.14.2"]}}
2022/07/16 05:35:40.973	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/fonts/roboto-regular.woff2", "headers": {"Authorization": [], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Fetch-Mode": ["cors"], "Accept-Language": ["en-US,en;q=0.9"], "Accept-Encoding": ["gzip, deflate, br"], "Sec-Fetch-Dest": ["font"], "Referer": ["https://tfprometheus.myvnc.com/assets/index.f7b571b2.css"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Ch-Ua-Mobile": ["?0"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["*/*"], "Sec-Fetch-Site": ["same-origin"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "username", "duration": 0.005745834, "size": 11016, "status": 200, "resp_headers": {"Date": ["Sat, 16 Jul 2022 05:35:57 GMT"], "Etag": ["\"62c6447b-2b08\""], "Content-Type": ["application/octet-stream"], "Content-Length": ["11016"], "Accept-Ranges": ["bytes"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Server": ["Caddy", "nginx/1.14.2"]}}
2022/07/16 05:35:40.974	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/fonts/roboto-bold.woff2", "headers": {"User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Fetch-Mode": ["cors"], "Accept-Language": ["en-US,en;q=0.9"], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Ch-Ua-Mobile": ["?0"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["*/*"], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Dest": ["font"], "Referer": ["https://tfprometheus.myvnc.com/assets/index.f7b571b2.css"], "Authorization": [], "Accept-Encoding": ["gzip, deflate, br"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "username", "duration": 0.006934824, "size": 11020, "status": 200, "resp_headers": {"Etag": ["\"62c6447b-2b0c\""], "Content-Type": ["application/octet-stream"], "Server": ["Caddy", "nginx/1.14.2"], "Date": ["Sat, 16 Jul 2022 05:35:57 GMT"], "Content-Length": ["11020"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Accept-Ranges": ["bytes"]}}
2022/07/16 05:35:40.984	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/sw.js", "headers": {"Referer": ["https://tfprometheus.myvnc.com/"], "If-None-Match": ["W/\"62c6447b-4699\""], "Cache-Control": ["max-age=0"], "Accept": ["*/*"], "Service-Worker": ["script"], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Dest": ["serviceworker"], "Sec-Fetch-Mode": ["same-origin"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept-Language": ["en-US,en;q=0.9"], "If-Modified-Since": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Accept-Encoding": ["gzip, deflate, br"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.000049309, "size": 0, "status": 401, "resp_headers": {"Server": ["Caddy"], "Www-Authenticate": ["Basic realm=\"restricted\""]}}
2022/07/16 05:35:41.009	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/sw.js", "headers": {"Referer": ["https://tfprometheus.myvnc.com/"], "Accept-Language": ["en-US,en;q=0.9"], "If-None-Match": ["W/\"62c6447b-4699\""], "Cache-Control": ["max-age=0"], "Authorization": [], "Accept": ["*/*"], "Service-Worker": ["script"], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Mode": ["same-origin"], "Sec-Fetch-Dest": ["serviceworker"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "If-Modified-Since": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Accept-Encoding": ["gzip, deflate, br"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "username", "duration": 0.002527614, "size": 0, "status": 304, "resp_headers": {"Etag": ["\"62c6447b-4699\""], "Date": ["Sat, 16 Jul 2022 05:35:57 GMT"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Server": ["Caddy", "nginx/1.14.2"]}}
2022/07/16 05:35:41.021	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57224", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/manifest.webmanifest", "headers": {"User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Mode": ["cors"], "Sec-Fetch-Dest": ["manifest"], "Accept-Language": ["en-US,en;q=0.9"], "Accept-Encoding": ["gzip, deflate, br"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Ch-Ua-Mobile": ["?0"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["*/*"], "Referer": ["https://tfprometheus.myvnc.com/"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.000050693, "size": 0, "status": 401, "resp_headers": {"Server": ["Caddy"], "Www-Authenticate": ["Basic realm=\"restricted\""]}}
2022/07/16 05:35:41.479	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57227", "proto": "HTTP/1.1", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/websocket", "headers": {"Upgrade": ["websocket"], "Sec-Websocket-Version": ["13"], "Accept-Encoding": ["gzip, deflate, br"], "Pragma": ["no-cache"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Websocket-Key": ["q1CBCul1aDklsQZ1aJNIGg=="], "Connection": ["Upgrade"], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Websocket-Extensions": ["permessage-deflate; client_max_window_bits"], "Cache-Control": ["no-cache"], "Authorization": [], "Accept-Language": ["en-US,en;q=0.9"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "http/1.1", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "username", "duration": 0.007942981, "size": 75, "status": 401, "resp_headers": {"Server": ["Caddy", "nginx/1.14.2"], "Date": ["Sat, 16 Jul 2022 05:35:58 GMT"], "Content-Type": ["text/html; charset=UTF-8"], "Content-Length": ["75"]}}

5. What I already tried:

I really don’t know enough about what I’m doing to have tried the right things. I’m just stumbling around in the dark.

6. Links to relevant resources:

Here is a link to an example of the Mainsail app: http://my.mainsail.xyz/

And here’s an example of it working when Mainsail is installed on the same machine as Caddy: https://lucaci32u4.xyz/blog/2021/mainsail-gateway.html

What do I need to do for the various calls to succeed with basic authentication enabled? I’m guessing this is something stupidly simple, but I’m not savvy enough to figure it out. Thank you for your help!

Your Caddyfile has invalid syntax. Global options must always be at the top.

I’d write it like this:

{
	debug
}

tfprometheus.myvnc.com {
	basicauth {
		username passwordhash
	}

	handle_path /modixcam/* {
		reverse_proxy 192.168.1.39:81
	}

	handle {
		reverse_proxy 192.168.1.123:80
	}

	log {
		output file /data/access.log
	}
}

I’m not seeing any issue from the access logs you posted though, most of the requests look authenticated (as you can see from the "user_id": "username" in them.

How are you making the requests?

Hi Francis, thank you for the fast response!

Ah, OK, will do. I had actually moved { debug } to the top after I wrote my message, but it didn’t seem to change anything in my file.

In the log, there are several info lines, and they have "user_id": "username" in them. But there are many error lines that don’t have the authentication info and have a status of 401.

2022/07/16 05:35:36.388	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/fonts/roboto-bold.woff2", "headers": {"Sec-Fetch-Dest": ["font"], "Accept-Encoding": ["gzip, deflate, br"], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Ch-Ua-Mobile": ["?0"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Fetch-Site": ["same-origin"], "Referer": ["https://tfprometheus.myvnc.com/assets/index.f7b571b2.css"], "Accept-Language": ["en-US,en;q=0.9"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["*/*"], "Sec-Fetch-Mode": ["cors"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.000051167, "size": 0, "status": 401, "resp_headers": {"Server": ["Caddy"], "Www-Authenticate": ["Basic realm=\"restricted\""]}}
2022/07/16 05:35:36.389	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/img/sidebar-background.svg", "headers": {"Sec-Fetch-Dest": ["image"], "Referer": ["https://tfprometheus.myvnc.com/"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Ch-Ua-Mobile": ["?0"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Mode": ["no-cors"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept-Language": ["en-US,en;q=0.9"], "Accept-Encoding": ["gzip, deflate, br"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.000027103, "size": 0, "status": 401, "resp_headers": {"Www-Authenticate": ["Basic realm=\"restricted\""], "Server": ["Caddy"]}}
2022/07/16 05:35:36.389	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/fonts/roboto-regular.woff2", "headers": {"Accept-Encoding": ["gzip, deflate, br"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["*/*"], "Sec-Fetch-Dest": ["font"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Mode": ["cors"], "Referer": ["https://tfprometheus.myvnc.com/assets/index.f7b571b2.css"], "Accept-Language": ["en-US,en;q=0.9"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Ch-Ua-Mobile": ["?0"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.000020509, "size": 0, "status": 401, "resp_headers": {"Server": ["Caddy"], "Www-Authenticate": ["Basic realm=\"restricted\""]}}
2022/07/16 05:35:36.389	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57099", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/fonts/roboto-medium.woff2", "headers": {"Sec-Ch-Ua-Mobile": ["?0"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["*/*"], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Dest": ["font"], "Referer": ["https://tfprometheus.myvnc.com/assets/index.f7b571b2.css"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Fetch-Mode": ["cors"], "Accept-Language": ["en-US,en;q=0.9"], "Accept-Encoding": ["gzip, deflate, br"], "Origin": ["https://tfprometheus.myvnc.com"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.00003005, "size": 0, "status": 401, "resp_headers": {"Server": ["Caddy"], "Www-Authenticate": ["Basic realm=\"restricted\""]}}
2022/07/16 05:35:37.397	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57192", "proto": "HTTP/1.1", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/websocket", "headers": {"User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept-Encoding": ["gzip, deflate, br"], "Sec-Websocket-Key": ["Zd8amMfOilUPZDtwShD/1A=="], "Sec-Websocket-Extensions": ["permessage-deflate; client_max_window_bits"], "Connection": ["Upgrade"], "Pragma": ["no-cache"], "Cache-Control": ["no-cache"], "Upgrade": ["websocket"], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Websocket-Version": ["13"], "Accept-Language": ["en-US,en;q=0.9"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "http/1.1", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.000051229, "size": 0, "status": 401, "resp_headers": {"Server": ["Caddy"], "Www-Authenticate": ["Basic realm=\"restricted\""]}}
2022/07/16 05:35:38.416	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57197", "proto": "HTTP/1.1", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/websocket", "headers": {"Cache-Control": ["no-cache"], "Upgrade": ["websocket"], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Websocket-Version": ["13"], "Accept-Encoding": ["gzip, deflate, br"], "Sec-Websocket-Key": ["3aJ4KsVVJoIOaNhs2MIf+Q=="], "Sec-Websocket-Extensions": ["permessage-deflate; client_max_window_bits"], "Connection": ["Upgrade"], "Pragma": ["no-cache"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept-Language": ["en-US,en;q=0.9"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "http/1.1", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.000045623, "size": 0, "status": 401, "resp_headers": {"Server": ["Caddy"], "Www-Authenticate": ["Basic realm=\"restricted\""]}}
2022/07/16 05:35:39.430	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57202", "proto": "HTTP/1.1", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/websocket", "headers": {"Pragma": ["no-cache"], "Cache-Control": ["no-cache"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept-Language": ["en-US,en;q=0.9"], "Sec-Websocket-Extensions": ["permessage-deflate; client_max_window_bits"], "Connection": ["Upgrade"], "Sec-Websocket-Version": ["13"], "Accept-Encoding": ["gzip, deflate, br"], "Sec-Websocket-Key": ["CFIuXzEt8r8nc/vI8n4z7w=="], "Upgrade": ["websocket"], "Origin": ["https://tfprometheus.myvnc.com"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "http/1.1", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.000053205, "size": 0, "status": 401, "resp_headers": {"Server": ["Caddy"], "Www-Authenticate": ["Basic realm=\"restricted\""]}}
2022/07/16 05:35:40.454	error	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "57206", "proto": "HTTP/1.1", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/websocket", "headers": {"User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Upgrade": ["websocket"], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Websocket-Version": ["13"], "Sec-Websocket-Key": ["XNSklXTKJr885JUUblS6jw=="], "Connection": ["Upgrade"], "Pragma": ["no-cache"], "Cache-Control": ["no-cache"], "Accept-Encoding": ["gzip, deflate, br"], "Accept-Language": ["en-US,en;q=0.9"], "Sec-Websocket-Extensions": ["permessage-deflate; client_max_window_bits"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "http/1.1", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.000051954, "size": 0, "status": 401, "resp_headers": {"Server": ["Caddy"], "Www-Authenticate": ["Basic realm=\"restricted\""]}}

I’m usually only asked for authentication once, then it loads the app and tries to connect to the backend until it times out. If it asks for authentication twice, it will fail immediately after I provide it.

As for how I’m making the requests, I don’t know how Mainsail / Moonraker works. I see in the github page it’s Javascript and SCSS, if that tells you anything. There’s a lot of communication back and forth with the web app and the server, but with the reverse_proxy, it looks like the web app loads, but then it says it can’t communicate with the backend.

For more info, here’s the log when I turn basic authentication off. Everything works fine.

2022/07/16 18:19:19.655	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "63246", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/", "headers": {"Pragma": ["no-cache"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept": ["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"], "Sec-Fetch-User": ["?1"], "Cache-Control": ["no-cache"], "Sec-Fetch-Site": ["none"], "Sec-Fetch-Mode": ["navigate"], "Sec-Fetch-Dest": ["document"], "Accept-Encoding": ["gzip, deflate, br"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept-Language": ["en-US,en;q=0.9"], "Sec-Ch-Ua-Mobile": ["?0"], "Upgrade-Insecure-Requests": ["1"], "Cookie": []}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.204010781, "size": 714, "status": 200, "resp_headers": {"Server": ["Caddy", "nginx/1.14.2"], "User_id": ["{http.auth.user.id}"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Content-Type": ["text/html"], "Vary": ["Accept-Encoding"], "Etag": ["W/\"62c6447b-725\""], "Cache-Control": ["no-store, no-cache, must-revalidate"], "Date": ["Sat, 16 Jul 2022 18:19:39 GMT"], "Content-Encoding": ["gzip"]}}
2022/07/16 18:19:19.721	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "63246", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/assets/index.f7b571b2.css", "headers": {"Sec-Ch-Ua-Platform": ["\"Windows\""], "Cookie": [], "Cache-Control": ["no-cache"], "Accept": ["text/css,*/*;q=0.1"], "Sec-Fetch-Site": ["same-origin"], "Referer": ["https://tfprometheus.myvnc.com/"], "Sec-Ch-Ua-Mobile": ["?0"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Fetch-Mode": ["no-cors"], "Accept-Language": ["en-US,en;q=0.9"], "Pragma": ["no-cache"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Fetch-Dest": ["style"], "Accept-Encoding": ["gzip, deflate, br"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.012499394, "size": 11273, "status": 200, "resp_headers": {"Server": ["Caddy", "nginx/1.14.2"], "User_id": ["{http.auth.user.id}"], "Date": ["Sat, 16 Jul 2022 18:19:39 GMT"], "Content-Type": ["text/css"], "Vary": ["Accept-Encoding"], "Etag": ["W/\"62c6447b-b3af\""], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Content-Encoding": ["gzip"]}}
2022/07/16 18:19:19.778	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "63246", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/assets/vendor.4ee48f24.css", "headers": {"Cookie": [], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Fetch-Site": ["same-origin"], "Accept-Language": ["en-US,en;q=0.9"], "Accept-Encoding": ["gzip, deflate, br"], "Pragma": ["no-cache"], "Cache-Control": ["no-cache"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["text/css,*/*;q=0.1"], "Sec-Fetch-Mode": ["no-cors"], "Sec-Fetch-Dest": ["style"], "Referer": ["https://tfprometheus.myvnc.com/"], "Sec-Ch-Ua-Mobile": ["?0"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.069459673, "size": 71853, "status": 200, "resp_headers": {"Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Date": ["Sat, 16 Jul 2022 18:19:39 GMT"], "Content-Type": ["text/css"], "Content-Encoding": ["gzip"], "Vary": ["Accept-Encoding"], "Etag": ["W/\"62c6447b-812d4\""], "Server": ["Caddy", "nginx/1.14.2"], "User_id": ["{http.auth.user.id}"]}}
2022/07/16 18:19:19.862	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "63246", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/assets/index.f5d6ee22.js", "headers": {"Pragma": ["no-cache"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Accept": ["*/*"], "Referer": ["https://tfprometheus.myvnc.com/"], "Accept-Language": ["en-US,en;q=0.9"], "Cache-Control": ["no-cache"], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Fetch-Site": ["same-origin"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Fetch-Mode": ["cors"], "Cookie": [], "Accept-Encoding": ["gzip, deflate, br"], "Sec-Ch-Ua-Mobile": ["?0"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Sec-Fetch-Dest": ["script"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.153709099, "size": 350174, "status": 200, "resp_headers": {"Etag": ["W/\"62c6447b-160564\""], "Date": ["Sat, 16 Jul 2022 18:19:39 GMT"], "Content-Type": ["application/javascript"], "Server": ["Caddy", "nginx/1.14.2"], "User_id": ["{http.auth.user.id}"], "Vary": ["Accept-Encoding"], "Content-Encoding": ["gzip"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"]}}
2022/07/16 18:19:19.907	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "63246", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/assets/vendor.60e31b64.js", "headers": {"Accept": ["*/*"], "Sec-Fetch-Site": ["same-origin"], "Sec-Ch-Ua-Mobile": ["?0"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Referer": ["https://tfprometheus.myvnc.com/"], "Pragma": ["no-cache"], "Cache-Control": ["no-cache"], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Fetch-Mode": ["cors"], "Sec-Fetch-Dest": ["script"], "Cookie": [], "Accept-Encoding": ["gzip, deflate, br"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept-Language": ["en-US,en;q=0.9"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.198923906, "size": 555970, "status": 200, "resp_headers": {"Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Date": ["Sat, 16 Jul 2022 18:19:39 GMT"], "Content-Encoding": ["gzip"], "Vary": ["Accept-Encoding"], "Etag": ["W/\"62c6447b-1ab72e\""], "Server": ["Caddy", "nginx/1.14.2"], "User_id": ["{http.auth.user.id}"], "Content-Type": ["application/javascript"]}}
2022/07/16 18:19:20.198	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "63246", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/img/icons/favicon-32x32.png", "headers": {"User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Cache-Control": ["no-cache"], "Sec-Ch-Ua-Mobile": ["?0"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"], "Sec-Fetch-Mode": ["no-cors"], "Sec-Fetch-Dest": ["image"], "Referer": ["https://tfprometheus.myvnc.com/"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Fetch-Site": ["same-origin"], "Accept-Language": ["en-US,en;q=0.9"], "Cookie": [], "Accept-Encoding": ["gzip, deflate, br"], "Pragma": ["no-cache"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.002811266, "size": 618, "status": 200, "resp_headers": {"Content-Length": ["618"], "Etag": ["\"62c6447b-26a\""], "Accept-Ranges": ["bytes"], "Server": ["Caddy", "nginx/1.14.2"], "User_id": ["{http.auth.user.id}"], "Content-Type": ["image/png"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Date": ["Sat, 16 Jul 2022 18:19:40 GMT"]}}
2022/07/16 18:19:20.198	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "63246", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/config.json", "headers": {"Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Fetch-Mode": ["cors"], "Pragma": ["no-cache"], "Sec-Ch-Ua-Mobile": ["?0"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Sec-Fetch-Site": ["same-origin"], "Cookie": [], "Cache-Control": ["no-cache"], "Accept": ["*/*"], "Sec-Fetch-Dest": ["empty"], "Accept-Encoding": ["gzip, deflate, br"], "Referer": ["https://tfprometheus.myvnc.com/"], "Accept-Language": ["en-US,en;q=0.9"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.002810534, "size": 5, "status": 200, "resp_headers": {"User_id": ["{http.auth.user.id}"], "Date": ["Sat, 16 Jul 2022 18:19:40 GMT"], "Etag": ["\"62c6447b-5\""], "Accept-Ranges": ["bytes"], "Content-Length": ["5"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Content-Type": ["application/json"], "Server": ["Caddy", "nginx/1.14.2"]}}
2022/07/16 18:19:20.375	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "63246", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/fonts/roboto-regular.woff2", "headers": {"Origin": ["https://tfprometheus.myvnc.com"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept-Language": ["en-US,en;q=0.9"], "Cookie": [], "Accept-Encoding": ["gzip, deflate, br"], "Pragma": ["no-cache"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Fetch-Dest": ["font"], "Referer": ["https://tfprometheus.myvnc.com/assets/index.f7b571b2.css"], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Mode": ["cors"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["*/*"], "Cache-Control": ["no-cache"], "Sec-Ch-Ua-Mobile": ["?0"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.003868797, "size": 11016, "status": 200, "resp_headers": {"Server": ["Caddy", "nginx/1.14.2"], "User_id": ["{http.auth.user.id}"], "Date": ["Sat, 16 Jul 2022 18:19:40 GMT"], "Etag": ["\"62c6447b-2b08\""], "Accept-Ranges": ["bytes"], "Content-Type": ["application/octet-stream"], "Content-Length": ["11016"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"]}}
2022/07/16 18:19:20.424	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "63246", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/fonts/roboto-medium.woff2", "headers": {"Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Accept": ["*/*"], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Dest": ["font"], "Referer": ["https://tfprometheus.myvnc.com/assets/index.f7b571b2.css"], "Accept-Language": ["en-US,en;q=0.9"], "Sec-Fetch-Mode": ["cors"], "Pragma": ["no-cache"], "Cache-Control": ["no-cache"], "Sec-Ch-Ua-Mobile": ["?0"], "Origin": ["https://tfprometheus.myvnc.com"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Cookie": [], "Accept-Encoding": ["gzip, deflate, br"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.003184779, "size": 11056, "status": 200, "resp_headers": {"User_id": ["{http.auth.user.id}"], "Date": ["Sat, 16 Jul 2022 18:19:40 GMT"], "Content-Type": ["application/octet-stream"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Etag": ["\"62c6447b-2b30\""], "Content-Length": ["11056"], "Accept-Ranges": ["bytes"], "Server": ["Caddy", "nginx/1.14.2"]}}
2022/07/16 18:19:20.425	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "63246", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/fonts/roboto-bold.woff2", "headers": {"Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept-Language": ["en-US,en;q=0.9"], "Accept-Encoding": ["gzip, deflate, br"], "Pragma": ["no-cache"], "Sec-Ch-Ua-Mobile": ["?0"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept": ["*/*"], "Sec-Fetch-Site": ["same-origin"], "Referer": ["https://tfprometheus.myvnc.com/assets/index.f7b571b2.css"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Origin": ["https://tfprometheus.myvnc.com"], "Sec-Fetch-Mode": ["cors"], "Cookie": [], "Cache-Control": ["no-cache"], "Sec-Fetch-Dest": ["font"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.004300796, "size": 11020, "status": 200, "resp_headers": {"Server": ["Caddy", "nginx/1.14.2"], "User_id": ["{http.auth.user.id}"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Accept-Ranges": ["bytes"], "Date": ["Sat, 16 Jul 2022 18:19:40 GMT"], "Content-Length": ["11020"], "Etag": ["\"62c6447b-2b0c\""], "Content-Type": ["application/octet-stream"]}}
2022/07/16 18:19:20.451	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "63246", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/img/sidebar-background.svg", "headers": {"Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept-Encoding": ["gzip, deflate, br"], "Referer": ["https://tfprometheus.myvnc.com/"], "Cookie": [], "Accept-Language": ["en-US,en;q=0.9"], "Sec-Ch-Ua-Mobile": ["?0"], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Mode": ["no-cors"], "Accept": ["image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"], "Sec-Fetch-Dest": ["image"], "Pragma": ["no-cache"], "Cache-Control": ["no-cache"], "Sec-Ch-Ua-Platform": ["\"Windows\""]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.002894323, "size": 2669, "status": 200, "resp_headers": {"Accept-Ranges": ["bytes"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Etag": ["\"62c6447b-a6d\""], "Server": ["Caddy", "nginx/1.14.2"], "User_id": ["{http.auth.user.id}"], "Date": ["Sat, 16 Jul 2022 18:19:40 GMT"], "Content-Type": ["image/svg+xml"], "Content-Length": ["2669"]}}
2022/07/16 18:19:20.497	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "63246", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/fonts/robotoMono-regular.woff", "headers": {"Origin": ["https://tfprometheus.myvnc.com"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["*/*"], "Sec-Fetch-Site": ["same-origin"], "Cookie": [], "Pragma": ["no-cache"], "Sec-Ch-Ua-Mobile": ["?0"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Fetch-Dest": ["font"], "Cache-Control": ["no-cache"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Fetch-Mode": ["cors"], "Accept-Language": ["en-US,en;q=0.9"], "Referer": ["https://tfprometheus.myvnc.com/assets/index.f7b571b2.css"], "Accept-Encoding": ["gzip, deflate, br"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.003751951, "size": 15160, "status": 200, "resp_headers": {"Content-Type": ["application/font-woff"], "Accept-Ranges": ["bytes"], "Etag": ["\"62c6447b-3b38\""], "Server": ["Caddy", "nginx/1.14.2"], "User_id": ["{http.auth.user.id}"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Content-Length": ["15160"], "Date": ["Sat, 16 Jul 2022 18:19:40 GMT"]}}
2022/07/16 18:19:21.240	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "63271", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/manifest.webmanifest", "headers": {"Sec-Ch-Ua-Mobile": ["?0"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept-Encoding": ["gzip, deflate, br"], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Mode": ["cors"], "Sec-Fetch-Dest": ["manifest"], "Referer": ["https://tfprometheus.myvnc.com/"], "Accept-Language": ["en-US,en;q=0.9"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept": ["*/*"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.002231787, "size": 435, "status": 200, "resp_headers": {"Accept-Ranges": ["bytes"], "Server": ["Caddy", "nginx/1.14.2"], "User_id": ["{http.auth.user.id}"], "Date": ["Sat, 16 Jul 2022 18:19:41 GMT"], "Content-Type": ["application/octet-stream"], "Content-Length": ["435"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Etag": ["\"62c6447b-1b3\""]}}
2022/07/16 18:19:21.252	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "63246", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/img/icons/icon-192-maskable.png", "headers": {"Sec-Ch-Ua-Platform": ["\"Windows\""], "Accept": ["image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Mode": ["no-cors"], "Referer": ["https://tfprometheus.myvnc.com/"], "Accept-Encoding": ["gzip, deflate, br"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Sec-Ch-Ua-Mobile": ["?0"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Sec-Fetch-Dest": ["image"], "Accept-Language": ["en-US,en;q=0.9"], "Cookie": []}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.00282035, "size": 7847, "status": 200, "resp_headers": {"Content-Type": ["image/png"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Content-Length": ["7847"], "Etag": ["\"62c6447b-1ea7\""], "Accept-Ranges": ["bytes"], "Date": ["Sat, 16 Jul 2022 18:19:41 GMT"], "Server": ["Caddy", "nginx/1.14.2"], "User_id": ["{http.auth.user.id}"]}}
2022/07/16 18:19:21.680	info	http.log.access.log0	handled request	{"request": {"remote_ip": "192.168.1.1", "remote_port": "63246", "proto": "HTTP/2.0", "method": "GET", "host": "tfprometheus.myvnc.com", "uri": "/fonts/roboto-light.woff2", "headers": {"Pragma": ["no-cache"], "Sec-Ch-Ua": ["\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\""], "Cookie": [], "Accept-Encoding": ["gzip, deflate, br"], "Origin": ["https://tfprometheus.myvnc.com"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"], "Accept": ["*/*"], "Sec-Fetch-Dest": ["font"], "Referer": ["https://tfprometheus.myvnc.com/assets/index.f7b571b2.css"], "Accept-Language": ["en-US,en;q=0.9"], "Cache-Control": ["no-cache"], "Sec-Ch-Ua-Mobile": ["?0"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Sec-Fetch-Site": ["same-origin"], "Sec-Fetch-Mode": ["cors"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "tfprometheus.myvnc.com"}}, "user_id": "", "duration": 0.004314145, "size": 11180, "status": 200, "resp_headers": {"Server": ["Caddy", "nginx/1.14.2"], "User_id": ["{http.auth.user.id}"], "Last-Modified": ["Thu, 07 Jul 2022 02:27:07 GMT"], "Content-Type": ["application/octet-stream"], "Content-Length": ["11180"], "Accept-Ranges": ["bytes"], "Date": ["Sat, 16 Jul 2022 18:19:41 GMT"], "Etag": ["\"62c6447b-2bac\""]}}

Does this help? Sorry, I’m really out of my element here.

Moonraker does some things with the Authorization header, which collides with Basicauth. This is a limitation of the Authorization header and how browsers implement that, which isn’t something Caddy can change :frowning:

At least one other person ran into the same problem, trying to use Moonraker with auth and Basicauth at reverse proxy level:

It basically comes down to “you can’t have both Moonraker auth and Caddy Basicauth enabled at the same time”.

I am not familiar with Moonraker/Mainsail, but it does seem to have some kind of user auth.
So I would argue you have to decide between the “dumb” Basicauth and Moonraker’s rather advanced user management capabilities :woman_shrugging:

1 Like

Enabling debug increases the verbosity of Caddy’s runtime logs, which you can see in your docker container’s logs.

Those aren’t the same as access logs which you also configured.

@IndeedNotJames Oh, thank you so much for pointing this out. I banged my head against it for many hours yesterday and couldn’t make an inch of progress.

I actually don’t have any authentication active on Moonraker. Or at least, not that I see on the client side. I’ve read that I can add a password, but I haven’t enabled that.

I see from your link that it’s looking for a json web token, and in that other page I provided (https://lucaci32u4.xyz/blog/2021/mainsail-gateway.html) it looks like he was able to get it to work using the jwt addon for Caddy. And for that I would have to compile Caddy… Seems like a lot more trouble than it’s worth. I might as well just add a password to the printer itself via Moonraker and call it a day.

If I’m going to do that, is there any security advantage in proxying through Cuddy? Or is it just another potential point of failure?

@francislavoie Gotcha, thanks. Yeah, I saw more on the Docker console, but it looked like all the relevant info was already in the log file.

This topic was automatically closed after 30 days. New replies are no longer allowed.