mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-17 05:04:21 +01:00
Allow use of ports other than 8123 in HA (#2307)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## 3.1.0
|
||||
|
||||
- Allow use of ports other than 8123 in Home Assistant Core
|
||||
|
||||
## 3.0.2
|
||||
|
||||
- Update Alpine to 3.14
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
version: 3.0.2
|
||||
version: 3.1.0
|
||||
hassio_api: true
|
||||
slug: nginx_proxy
|
||||
name: NGINX Home Assistant SSL proxy
|
||||
description: An SSL/TLS proxy
|
||||
|
||||
@@ -58,7 +58,7 @@ http {
|
||||
#include /share/nginx_proxy_default*.conf;
|
||||
|
||||
location / {
|
||||
proxy_pass http://homeassistant.local.hass.io:8123;
|
||||
proxy_pass http://homeassistant.local.hass.io:%%HA_PORT%%;
|
||||
proxy_set_header Host $host;
|
||||
proxy_redirect http:// https://;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
@@ -13,6 +13,8 @@ KEYFILE=$(bashio::config 'keyfile')
|
||||
CERTFILE=$(bashio::config 'certfile')
|
||||
HSTS=$(bashio::config 'hsts')
|
||||
|
||||
HA_PORT=$(bashio::core.port)
|
||||
|
||||
# Generate dhparams
|
||||
if ! bashio::fs.file_exists "${DHPARAMS_PATH}"; then
|
||||
bashio::log.info "Generating dhparams (this will take some time)..."
|
||||
@@ -52,6 +54,7 @@ fi
|
||||
sed -i "s#%%FULLCHAIN%%#$CERTFILE#g" /etc/nginx.conf
|
||||
sed -i "s#%%PRIVKEY%%#$KEYFILE#g" /etc/nginx.conf
|
||||
sed -i "s/%%DOMAIN%%/$DOMAIN/g" /etc/nginx.conf
|
||||
sed -i "s/%%HA_PORT%%/$HA_PORT/g" /etc/nginx.conf
|
||||
|
||||
[ -n "$HSTS" ] && HSTS="add_header Strict-Transport-Security \"$HSTS\" always;"
|
||||
sed -i "s/%%HSTS%%/$HSTS/g" /etc/nginx.conf
|
||||
|
||||
Reference in New Issue
Block a user