A request from a reverse proxy was received from

hello i have a problem with this…

2021-06-07 20:09:20 WARNING (MainThread) [homeassistant.components.http.forwarded] A request from a reverse proxy was received from 172.30.33.8, but your HTTP integration is not set-up for reverse proxies; This request will be blocked in Home Assistant 2021.7 unless you configure your HTTP integration to allow this header

i don’t understand what is this :sob:

1 Like

See this topic:

and read the release notes when upgrading:

Well that answer does not really say much, does it? Nor does reading the page you are referring to.
I have a plain vanilla installation of Home Assistant and I only use some of the build-in integrations. I have not set up anything to use a reverse proxy, so it must be some of the core / built-in stuff which is causing this.

Reading the release notes simply says some http proxy stuff has been deprecated. I do read this information regularly; and think that it will not affect me as I have not set up anything except for official built-in plugins and integrations… Yet it does happen to me, so a more useful answer would be listing common causes and how to resolve it. It is to typically Home Assistant that even a senior developer have no idea of what happens when inspecting the not-so-useful log files and/or history of entities or anything. We never see the real name of failing functions, just row 0 column 0 in some random .py-file far away from the root cause.

Home Assistant should in this case print WHICH integration and/or feature that is using the deprecated reverse proxy. I mean, it is just a deprecation warning, so everything is still working. So Home Assistant must know what was actually using the reverse proxy in a deprecated way. Why not just print it so that one could understand who is the culprit? Perhaps put pressure on whatever integration that does not stick to best practices and/or blame Home Assistant for deprecating it’s own stuff before actually migrating to whatever need migrating to.

OK, that’s a bit different. Have you set up Nginx? Is your installation Home Assistant OS on e.g. a Pi?

… and would you use a “plain” proxy on your network?

Not intentionally, if Nginx is running and/or is configured in any way it must be the work of Home Assistant and/or anything that goes with the vanilla installation.

Yepp.

  • Home Assistant OS 6.0 on a Raspberry Pi 4.
  • core-2021.6.4
  • supervisor-2021.06.0

Only installed some of the Official add-ons; no community and/or custom ones. So in my view this error /deprecation warning should not happen in the first place; and if it does happen, why on earth is the error not saying anything of what service and/or system and/or source and/or add-on is causing this?

The log is full of (a couple of times per hour):

2021-06-13 18:03:07 WARNING (MainThread) [homeassistant.components.http.forwarded] A request from a reverse proxy was received from 172.30.33.4, but your HTTP integration is not set-up for reverse proxies; This request will be blocked in Home Assistant 2021.7 unless you configure your HTTP integration to allow this header

I guess I have to wait until something actually breaks; and hope that whatever is breaking will report it. Because, again, home assistant logs are very confusing. Even when the problem is obviously in one of the configuration files; it still points to the main configuration.yaml-file on the first row and says something about some obscure .py-file somewhere, even if I simply forget to have a colon in a scripts.yaml-file.

2 Likes

TL;DR just add the following lines to the http: section of your configuration.yaml

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.30.33.0/24

This allows local reverse proxies access, and will eliminate the warnings from your log file. And you won’t have to worry about your proxy connections breaking when 2021.7 comes out.

7 Likes

Thank you for the heads up
My reverse proxy broke after the 2021.7 update. Unfortunately I am still learning on this reverse proxy topic
I added your suggestion but the config file does not pass the initial check.
This is what I added:

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 192.168.0.124/24

And this is the error I get when I test the config file:

Invalid config for [http]: not a valid value @ data[‘http’][‘trusted_proxies’][0]. Got ‘192.168.0.124/24’. (See /config/configuration.yaml, line 5).

In the server log (before any changes in the config after the .7 update)
The following Error:

  Logger: homeassistant.components.http.forwarded
Source: components/http/forwarded.py:91
Integration: HTTP (documentation, issues)
First occurred: 11:01:32 AM (28 occurrences)
Last logged: 11:28:54 AM
A request from a reverse proxy was received from 192.168.0.124, but your HTTP integration is not set-up for reverse proxies

My HASS server is running local on a virtual machine on my server with Apache as reverse proxy.
Can you or someone else help me ?

192.168.0.124/24 isn’t valid.
Try 192.168.0.0/24 or 192.168.0.124 instead

Thnx! :slight_smile: That was a quick fix.
And am I correct if I say 192.168.0.0/24 will allow all IP addresses in the range of 192.168.0.1 to 254?

On that note All log entries about wrong login attempts are reported from my ip of my proxy server (what makes sense)
But I found a fix for that by adding a line in my Apache config.
Will that break this setup?

I can’t find that configuration suggestion any more… so never mind I guess

You don’t want to use that. Use the specific ip, not the whole range.

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.30.33.6

Just use the ip from the errors in the log file.

2 Likes

Thank you I will change that