Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login does not work if Web UI is behind reverse proxy #736

Open
jacotec opened this issue Aug 21, 2024 · 2 comments
Open

Login does not work if Web UI is behind reverse proxy #736

jacotec opened this issue Aug 21, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jacotec
Copy link

jacotec commented Aug 21, 2024

Describe the bug
I run the Defguard VM using my subdomain "vpn.mydomain.com". Port 443 can't be used as this is required on this VM for OpenVPN traffic, so I've changed the web UI of Defguard to use port 8443.

Access using "https://vpn.mydomain.com:8443" works without issues.

To access the UI with a "normal" URL without special port number, I've configured my HAPROXY reverse proxy for accessing the UI with "https://wireguard.mydomain.com".

Using "https://wireguard.mydomain.com" correctly serves the Defguard UI, but after entering the credentials the button "Sign in" does nothing.

The core container gives the error log message:

core-1 | 2024-08-21T14:19:02.222209Z ERROR http_request{method=GET path=/api/v1/info}: defguard::handlers: msg="Session is required"

In this case.

Expected behavior
I want to be able to run the Web UI behind a reverse proxy.

Version information

  • Defguard Core version: v0.11.0
  • Defguard Gateway version: No idea, latest and greatest Docker version
    • Operating system and version running the gateway: Ubuntu 22.04
  • Your browser and version [e.g. chrome 99, safari] All browsers affected: Chrome, Edge, Firefox, Safari
@jacotec jacotec added the bug Something isn't working label Aug 21, 2024
@jacotec
Copy link
Author

jacotec commented Aug 21, 2024

Looking at the network traffic in the browser dev tools it turns out that Defguard wants to set a cookie with the domain

vpn.mydomain.com

image

Although in the .ENV file I've added the line:

DEFGUARD_COOKIE_DOMAIN=wireguard.mydomain.com

Looks like the DEFGUARD_COOKIE_DOMAIN is not used here ...?!?

@jacotec
Copy link
Author

jacotec commented Aug 21, 2024

If further turns out that the DEFGUARD_COOKIE_DOMAIN needs to be passed in the environment: section in the docker-compose file.

Adding the line

DEFGUARD_COOKIE_DOMAIN: ${DEFGUARD_COOKIE_DOMAIN}

under

core:
  environment:

in the docker-compose solves the issue.

I'm leaving this open as this is a potential issue with the setup script creating the docker-compose file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant