Last active
August 29, 2023 13:07
-
-
Save gerardo-junior/71aebc33949e34fac6316726db5fb8f7 to your computer and use it in GitHub Desktop.
Reverse proxy config for diyhue works with alexa running on the same host with multiple services on port 80/443 after pairing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set $upstream_app diyhue; | |
set $upstream_port 80; | |
set $upstream_proto http; | |
include /config/nginx/proxy.conf; | |
include /config/nginx/resolver.conf; | |
# allow controlling lights | |
location ~ ^/api/(.*)/lights/(.*)/state[/]*$ | |
{ | |
proxy_pass $upstream_proto://$upstream_app:$upstream_port/api/$1/lights/$2/state; | |
limit_except GET PUT { | |
deny all; | |
} | |
} | |
# allow controlling groups | |
location ~ ^/api/(.*)/groups/(.*)/action[/]*$ | |
{ | |
proxy_pass $upstream_proto://$upstream_app:$upstream_port/api/$1/groups/$2/action; | |
limit_except GET PUT { | |
deny all; | |
} | |
} | |
# deny get configs keys | |
location ~ ^/api/(.*)/config | |
{ | |
deny all; | |
} | |
# everything else is read-only | |
location ~ ^/api/(.*)$ | |
{ | |
proxy_pass $upstream_proto://$upstream_app:$upstream_port/api/$1; | |
limit_except GET { | |
deny all; | |
} | |
} | |
# https://community.openhab.org/t/howto-hide-hue-bridge-behind-reverse-proxy/79744 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment