OBS cannot connect to server rtmp port when port is forwarded on router

I am trying to set up live streaming on my instance, but I have issues with the rtmp port. My server is hosted made accessible via a reverse proxy running on another machine, but still on the same network. Due to my reverse proxy software (caddy) not being able to handle rtmp traffic (as far as I know), I have just set up a port forward from the machine running the peertube instance (on docker) to the router.

When trying to stream using the above configuration, OBS tries to connect to the server and doesn’t fail immediately; instead, it takes a few seconds for it to stop (which I think means that there is a route to the server). As opposed to that, when the port forward on the router is wrong, when the port on the rtmp url is different, when trying to use directly an ip like « localhost » or the local ip of the machine, OBS fails immediately.

I’ve never done livestreaming with Peertube, but I saw a video about it yesterday.
Have you try using rtmps like explained here? https://video.fedihost.co/w/dAoCCAVrJ1t7xQw7U9GUbu?start=6m27s