OPNsense Forum

Archive => 19.1 Legacy Series => Topic started by: Tubs on June 02, 2019, 02:27:29 PM

Title: nginx and autodiscover basic authentication on upsream server
Post by: Tubs on June 02, 2019, 02:27:29 PM
Hello,

somehow my Exchange autodiscover does not work behind nginx as revers proxy. When I connect directly to the server it works. But behind OPNsense with nginx as reverse proxy autodiscover will end up in http 401 error.

Unfortunately, I don't see anything in the logs that gives me a hint were to search.

Basically, I am fine with either basic authentication pass through or authentication by OPNsense to LDAP server. Whatever is running is fine.

The rest like activesync and owa is running through opnsense.

Any idea where to search?
Title: Re: nginx and autodiscover basic authentication on upsream server
Post by: fabian on June 02, 2019, 03:52:19 PM
401 means "authentication required" so you enforce authentication on an URL and the client does not provide it.
Title: Re: nginx and autodiscover basic authentication on upsream server
Post by: Tubs on June 03, 2019, 02:09:16 PM
Yes, that's the point. Maybe my explanation was not clear.
But the authentication error is caused by nginx not forwarding credentials correctly.
(I assume nginx is doing what it is supposed to do by the actual settings. But this is not what I want)

I am testing by web browser by opening autodiscover xml file manually
https://autodiscover.xxxx.xxx/Autodiscover/Autodiscover.xml

In case of direct access by internal LAN address:
Browser authentication windows open, enter credentials, expected xml response comes

In case of access via external address through nginx reverse proxy
Browser authentication windows open, enter credentials, authentication windows ask again for credentials.

In case of access through Microsoft Autodiscover test page I see more details: error 401
Title: Re: nginx and autodiscover basic authentication on upsream server
Post by: fabian on June 03, 2019, 07:31:19 PM
Hast du dir das schon angeschaut, vielleicht hat der ein Problem mit dem default realm etc.

https://stackoverflow.com/questions/14839712/nginx-reverse-proxy-passthrough-basic-authenication