Skip to content

Commit e0d73b0

Browse files
andriejfabaff
authored andcommitted
Update notify.html5.markdown (home-assistant#1916)
Configuration addon resolving html5 callback security issue with htpasswd nginx proxy
1 parent 265168b commit e0d73b0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

source/_components/notify.html5.markdown

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,27 @@ You will receive an event named `html5_notification.closed` when the notificatio
236236
platform: event
237237
event_type: html5_notification.closed
238238
```
239+
240+
### {% linkable_title Making notifications work with NGINX proxy %}
241+
242+
If you use [NGINX](/ecosystem/nginx/) as an proxy with authentication in front of HASS, you may have trouble with receiving events back to HASS. It's because of authentication token that cannot be passed through the proxy.
243+
244+
To solve the issue put additional location into your nginx site's configuration:
245+
246+
```bash
247+
location /api/notify.html5/callback {
248+
if ($http_authorization = "") { return 403; }
249+
allow all;
250+
proxy_pass http://localhost:8123;
251+
proxy_set_header Host $host;
252+
proxy_redirect http:// https://;
253+
}
254+
```
255+
256+
This rule check if request have `Authorization` HTTP header and bypass the htpasswd (if you use one).
257+
258+
If you still have the problem, even with mentioned rule, try to add this code:
259+
```bash
260+
proxy_set_header Authorization $http_authorization;
261+
proxy_pass_header Authorization;
262+
```

0 commit comments

Comments
 (0)