I want to setup nginx as a reverse proxy. to be able to test the reverse proxy by running two websites in two containers which are published on my RPi 4 host on 2 different ports.
the hello world container only runs once and then stops. how can I run to small containers that keep on running ?
The only thing the site should be able to show is someting like:
‘website 1’ and the other one ‘website 2’
You need a container that actually has a web fronted. I am afraid a “hello world” container does not come with a web frontend.
Why not simply use nginx for both containers, each with different version. Call a non-existing url for each container to see the version in the error page it returns.
Of course, you could use any arbitrary container that has a web frontend.
You could use nginx:alpine image
- with only 60 MB you could run your nginx as a reverse proxy and as many as sites as you want
- you would just need to configure one instance as a reverse proxy and any other one you need to change the html located normally in
/usr/share/nginx/html (may change) to be as you want
- Here is a 7 min vedio from youtube
note that any container you run from the same image has 2 size values
- actual : is what you changed
- virtual : is actual + image size (which is allocated once) see this github replay
this means no problem with size (only what you edit on the image is what changes it’s size)