Questions about Hassio Ingress

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:

172.30.32.2 - - [14/Sep/2024:00:16:46 +0200] "GET / HTTP/1.1" 200 337 "https://REDACTED.duckdns.org/hassio" "Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0"

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?

Thanks!
Francesco

No need to create an addon, just use ingress integration and configure. GitHub - lovelylain/hass_ingress: Home Assistant ingress feature, add additional ingress panels to your Home Assistant frontend.

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 :slight_smile:

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:

https://REDACTED.duckdns.org/api/hassio_ingress/<pseudo-random-string>/FOOBAR

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?

I did try also GitHub - albertogeniola/angular-hello-addon but it does not seem to work (I opened an issue at Not working with HA 2024.9.1 · Issue #3 · albertogeniola/angular-hello-addon · GitHub)

Thanks!