Hey all,
I’m trying to develop a simple addon that exposes a (basic) web app.
So far I was able to put in the docker image of my addon an nginx server listening on port 8099 and serving a static index.html file “hello world” style.
Now I’m trying to raise the bar and serve an app built using Angular… and I’m having troubles.
So here’s my basic question around Hassio Ingress: when I click on the “open UI” for my addon my browser now shows as address something like https://REDACTED.duckdns.org/hassio/ingress/79957c2e_dnsmasq-dhcp
and then I see in my nginx access log an entry like:
So I understand the ingress is translating the path /hassio/ingress/79957c2e_dnsmasq-dhcp to just / (as it appears in the HTTP GET received).
I was then expecting that if I point my browser to https://REDACTED.duckdns.org/hassio/ingress/79957c2e_dnsmasq-dhcp/FOOBAR
I should be able to see in the access logs of nginx an HTTP GET with path /FOOBAR.
This does not happen.
Instead I get a page with a message from Supervisor saying “Cannot retrieve information from the addon to start Ingress”.
What am I missing?
Let’s say my nginx server is serving a page index.html and that page needs to fetch a static image, what URL should be there inside the “src” attribute of the tag so that my nginx receives the associated HTTP GET?
Hi @lovelylain ,
I would like to roll my own addon as I need to run some software in a separate docker … Does your hass_ingress simplifies somehow the issue I described in my original post?
An addon is just a special container that relies on supervisor to facilitate user use and configuration, but making an addon is not easy. You can run your own normal container and then use ingress to integrate it into homeassistant.
hey @lovelylain ,
thanks for that. However I would like to give addons another try, before I give up
An update on the issue I’m encountering.
I discovered that I can fetch any resource served by addon, e.g. the resource “FOOBAR”, if I launch an HTTP GET to the following URL:
when the pseudo-random-string is what I can find inside the “%%ingress_entry%%” configuration variable.
However my question now is: given that my Angular application to work needs to download stuff like “polyfill.js”, “main.js” and others, and given that the pseudo-random-string after the “api/hassio_ingress” is something that changes every time… do you know a way to tell Angular to use %%ingress_entry%% as prefix for resources like “polyfill.js”, “main.js”, etc?