SOLVED: Running behind reverse proxy: frappe.exceptions.AuthenticationError: Kennwort nicht gefunden

Hi again,

I am running a local dev-server and I wanted to make it accessible from the Internet.
I am running an opnsense firewall and have HAProxy configured as reverse proxy.
Another Service (jitsi) runs just fine.

However, when I try to access my ERPNext via the public address, I get the error:

14:41:13 web.1            | Traceback (most recent call last):
14:41:13 web.1            |   File "/home/dominik/frappe-bench/apps/frappe/frappe/app.py", line 62, in application
14:41:13 web.1            |     response = frappe.api.handle()
14:41:13 web.1            |   File "/home/dominik/frappe-bench/apps/frappe/frappe/api.py", line 39, in handle
14:41:13 web.1            |     validate_auth_via_api_keys()
14:41:13 web.1            |   File "/home/dominik/frappe-bench/apps/frappe/frappe/api.py", line 181, in validate_auth_via_api_keys
14:41:13 web.1            |     raise e
14:41:13 web.1            |   File "/home/dominik/frappe-bench/apps/frappe/frappe/api.py", line 176, in validate_auth_via_api_keys
14:41:13 web.1            |     validate_api_key_secret(token[0], token[1])
14:41:13 web.1            |   File "/home/dominik/frappe-bench/apps/frappe/frappe/api.py", line 190, in validate_api_key_secret
14:41:13 web.1            |     user_secret = frappe.utils.password.get_decrypted_password ("User", user, fieldname='api_secret')
14:41:13 web.1            |   File "/home/dominik/frappe-bench/apps/frappe/frappe/utils/password.py", line 49, in get_decrypted_password
14:41:13 web.1            |     frappe.throw(_('Password not found'), frappe.AuthenticationError)
14:41:13 web.1            |   File "/home/dominik/frappe-bench/apps/frappe/frappe/__init__.py", line 377, in throw
14:41:13 web.1            |     msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable)
14:41:13 web.1            |   File "/home/dominik/frappe-bench/apps/frappe/frappe/__init__.py", line 356, in msgprint
14:41:13 web.1            |     _raise_exception()
14:41:13 web.1            |   File "/home/dominik/frappe-bench/apps/frappe/frappe/__init__.py", line 316, in _raise_exception
14:41:13 web.1            |     raise raise_exception(msg)
14:41:13 web.1            | frappe.exceptions.AuthenticationError: Password not found

It works perfectly well, if I am on my local network and use the local address of the server.
I suppose it has to do with the nginx configuration. Or my firewall settings?

Any ideas on how to solve this?

Thanks!
DoCa

I now found a solution to make frappe user authenticatio work behind a reverse proxy with basic auth:

I added the following two options in the backend for HYProxy:

http-request set-header Host frappe.home.local
http-request del-header Authorization

with these present, I can now log into my frappe server.