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

Authorize via reverse proxy not working #17434

Closed
teunehv opened this issue Oct 14, 2018 · 9 comments
Closed

Authorize via reverse proxy not working #17434

teunehv opened this issue Oct 14, 2018 · 9 comments

Comments

@teunehv
Copy link

teunehv commented Oct 14, 2018

Home Assistant release with the issue:

Home Assistant 0.80.0 (via Hass.io)

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.):

Hass.io

Component/platform:

https://www.home-assistant.io/components/google_assistant/

Description of problem:
I’m running Hass.IO behind a reverse nginx proxy.

    location /hassioproxy/ {
      include /config/nginx/proxy.conf;
      rewrite /hassioproxy/(.*) /$1 break;
      proxy_pass http://my.local.hassio:8123;

In configuration.yaml I have the entry

    http:
      base_url: https://my.external.url/hassioproxy

I can connect to the API endpoint at: https://my.external.url/hassioproxy/api/

When I browse to the authentication url: https://my.external.url/hassioproxy/auth/authorize
it redirects to: https://my.external.url/frontend_es5/authorize.html

So it seems the redirect doesn't take the reverse proxy into account.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

    http:
      base_url: https://my.external.url/hassioproxy

Traceback (if applicable):


Additional information:
Already confirmed by awarecan it's an issue, see
https://community.home-assistant.io/t/v0-80-new-google-assistant-auth-behind-proxy-redirect-issue/72994

@awarecan
Copy link
Contributor

The issue is not about google assistant component, but for the HA in general. Do we want to support base_url with path? There are several 302 redirect in the code will redirect base on absolute path, if we want to fix it, we may need add virtual_path or something similar in http config.

@tschundler
Copy link

I was confused trying to set it up today. I have a variety of things on different paths like Octoprint, Jupyter Notebook, with authentication managed through the nginx.
Even if base_url doesn't support paths, X-Script-Name header would help. That's a standard approach for what I think you're imagining "virtual_path" configuration would be.

@marchingphoenix
Copy link
Contributor

i use an nginx reverse proxy and do not currently have any issues on 83+
Can one of you please test and see if this is still a problem?

@benleb
Copy link
Contributor

benleb commented Jan 6, 2019

@marchingphoenix maybe you want to show us your nginx config?

@teunehv
Copy link
Author

teunehv commented Mar 8, 2019

i use an nginx reverse proxy and do not currently have any issues on 83+
Can one of you please test and see if this is still a problem?

Just tested on 0.89, for the issue is still present.

@marchingphoenix can you post your nginx config perhaps?

@benleb
Copy link
Contributor

benleb commented Mar 10, 2019

It seems that nobody (from the home assistant team) cares about this, but why?!
Are there really just a hand full people which want to use a stable and extensively tested reverse proxy in front of (sometimes beta-like) home assistant?!

@awarecan
Copy link
Contributor

Reverse proxy works, we have tons of guide in the community to show you the way. The issue here is about host HA in a virtual path, and it is complex. The most recent discussion at here: home-assistant/architecture#156

@teunehv
Copy link
Author

teunehv commented Mar 10, 2019

Got it workin tonight via https://community.home-assistant.io/t/nginx-reverse-proxy-set-up-guide-docker/54802

Its not using the path but a subdomain, for me this workaround suits my needs for now.

@balloob
Copy link
Member

balloob commented Mar 19, 2019

Going to close this as we don't intend to support this now, and no one is going to work on this in the foreseeable future.

@balloob balloob closed this as completed Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants