I have setup domoticz to run behind a reverse proxy and followed this guide
https://www.domoticz.com/wiki/WebServer_Proxy
I have setup nginx as the guide and also added my proxys ip to trusted networks.
I can access domoticz from everywhere and I have to enter credentials and OTP to login. This works great.
But I want to do a JSON call to toggle a switch from remote.
I paste this command in safari to test it when I on 4G
https://user:password@domain/json.htm?t ... cmd=Toggle
but then I get 401 Unauthorized
I have added the device in "Set devices" under user, and the user have user rights.
I get this in my logs
Code: Select all
2024-09-03 12:45:00.299 Debug: [web:8080] Host:192.168.x.x Uri:/json.htm?type=command¶m=switchlight&idx=775&switchcmd=Toggle
2024-09-03 12:45:00.299 Debug: [web:8080] Request Headers:
Host: [domain]
X-Real-IP: [4G IP]
X-Forwarded-For: [4G IP]
X-Forwarded-Proto: https
X-Scheme: https
Connection: close
accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
sec-fetch-site: none
accept-encoding: gzip, deflate, br
sec-fetch-mode: navigate
user-agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/128.0.6613.34 Mobile/15E148 Safari/604.1
accept-language: sv-SE,sv;q=0.9
sec-fetch-dest: document
2024-09-03 12:45:00.299 Debug: [web:8080] IP (192.168.x.x) is within Trusted network range!
2024-09-03 12:45:00.299 Debug: [web:8080] Did not find suitable Authorization!
2024-09-03 12:45:00.299 Debug: Web ACLF: [4G IP] - - [03/Sep/2024:12:45:00.299 +0200] "GET /json.htm?type=command¶m=switchlight&idx=775&switchcmd=Toggle HTTP/1.1" 401 91 - "M>