Web services using containers

Morning.

Wanting to get ahead of myself a bit and ask a couple proxy server questions.

Currently I use Ubuntu 22.04 running in a Windows Hypervisor and apache proxy setup to handle multiple web services (sites).

Using Incus, the way I understand this is best handled is by creating a container which the runs proxy services and routes to the specific container running web server or Go app (web page).

Is that correct…or close?

You likely have several domains for your Web services and you want a way so that each connection is directed to the appropriate container.
You would use a reverse proxy in a container so that the reverse proxy can direct each connection to that appropriate container.

There are many options for such a reverse proxy, including HAProxy, nginx and Apache (in reverse proxy mode), etc.

You may also want to look into the PROXY protocol, which is supported in any proxy software. What Is the PROXY Protocol? How It Preserves Client IPs

Good, I’m on the same page. So essentially I could continue using Apache, except the proxy will direct to the appropriate container.

Is Traefik an option as well

Yes, Traefik can perform as a reverse proxy as well. Here is the full list of such software.

Yes.

If the proxy and the target containers are on the same incus bridge, then it can use the DNS names registered in dnsmasq (e.g. http://foo.incus/ to reach container foo)

The proxy itself can accept incoming connections from the outside world using an incus proxy device - e.g. the proxy device can listen on port 443 on the host, and forward this to the proxy sitting on incusbr0.

Would like to highlight GitHub - jochumdev/incus-caddy-config: Dynamic, zero-touch reverse proxy configuration for Caddy on Incus, driven by instance lifecycle events · GitHub here.

It’s getting a rewrite by @tallica to “incus-templated” no need to configure anything with it.