krosseyed
(Krosseyed)
January 4, 2023, 7:16am
1
Wanted to see what I needed to get Apache working with ESPHome in a Reverse Proxy setup. It looks like this is the only app that does not like the HTTPS setup.
I have followed the guide below, and it seems to work for everything else but ESPHome:
This guide has been migrated from our website and might be outdated. Feel free to edit this guide to update it, and to remove this message after that.
This example demonstrates how you can configure Apache to act as a proxy for Home Assistant.
This is useful if you want to have:
a subdomain redirecting to your Home Assistant instance
several subdomains for several instances
HTTPS redirection
Subdomain
So you already have a working Apache server available at example.org . Your Home …
I have also looked at the following issue, which is what led me to check my Apache configuration:
opened 02:31PM - 04 Feb 20 UTC
closed 05:39PM - 23 May 21 UTC
stale
<!-- Thanks for reporting a bug for this project. READ THIS FIRST:
- Provide … as many details as possible. Simply saying "X gives bug" or "X gives error" is not enough!
- Paste logs, configuration sample and code into the backticks (```).
- Read through the template carefully and fill out all missing details.
- Please also search for similar issues in this issue tracker first and read through the ESPHome FAQ.
DO NOT DELETE ANY TEXT from this template! Otherwise the issue may be closed without a comment.
-->
**Operating environment/Installation (Hass.io/Docker/pip/etc.):**
<!--
Please provide details about your environment below this line. -->
hassio running on Ubuntu 18.04.2 LTS
**ESP (ESP32/ESP8266, Board/Sonoff):**
<!--
Please provide details about which ESP you're using below.
-->
**Affected component:**
<!--
Please add the link to the documentation at https://esphome.io/index.html of the component in question.
-->
**Description of problem:**
This whole thing started when I installed the SSL proxy addon. Basically, if accessing HA via domain name and SSL ESPHome loads the web UI but whatever i click from there I get "terminated process" and nothing happens. If I reach the HA instance via local ip over http (no ssl) - it's all good. Getting these errors all the time:
```
2020-02-04 16:10:28 WARNING (MainThread) [aiohttp.websocket] websocket connection is closing.
2020-02-04 16:10:57 WARNING (MainThread) [aiohttp.websocket] websocket connection is closing.
2020-02-04 16:11:03 WARNING (MainThread) [aiohttp.websocket] websocket connection is closing.
```
```
20-02-04 14:00:07 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:00:09 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:00:13 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:00:15 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:00:19 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:00:21 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:00:25 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:00:27 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:00:31 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:00:33 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:00:37 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:00:39 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:00:43 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:00:45 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:00:49 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:00:51 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:00:55 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:00:57 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:01:01 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:01:03 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
20-02-04 14:01:07 ERROR (MainThread) [hassio.api.ingress] Ingress error: 403, message='Invalid response status', url='http://172.30.32.1:62520/ace
```
from the ESPHOME addon log:
```
WARNING 403 GET /ace (0.0.0.0) 3.11ms
WARNING 403 GET /ace (0.0.0.0) 2.01ms
WARNING 403 GET /ace (0.0.0.0) 2.61ms
WARNING 403 GET /ace (0.0.0.0) 1.50ms
WARNING 403 GET /ace (0.0.0.0) 1.81ms
WARNING 403 GET /ace (0.0.0.0) 2.45ms
```
**Problem-relevant YAML-configuration entries:**
```yaml
PASTE YAML FILE HERE
```
**Logs (if applicable):**
<!--
Please copy the debug log here. If possible, also connect to the ESP over USB and copy those logs into the backticks.
-->
```
PASTE DEBUG LOG HERE
```
**Additional information and things you've tried:**
I am getting the following error in my ESPHome logs when viewing my node logs:
WARNING 400 GET /logs (0.0.0.0) 1.66ms
1 Like
fishead
(Andrej Hraško)
March 20, 2024, 6:01pm
2
Hello!
Add this line above your ProxyPass line in Apache config:
ProxyPreserveHost On
I have forwarded port 8123 from HA via ssh port forward to my server.
My current vhost apache config in ispconfig (Apache Directives) looks like this:
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
RewriteRule ^ - [END]
RewriteCond %{HTTP_HOST} ^YOUR_HOST$ [NC]
RewriteCond %{HTTP:Connection} Upgrade [NC]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule ^/?(.*) ws://127.0.0.1:8123/$1 [P,L]
ProxyPreserveHost On
ProxyPass "/" "http://127.0.0.1:8123/"
ProxyPassReverse "/" "http://127.0.0.1:8123/"
Hope this helps!