Hi all,
I’ve created a droplet using the 1-click installer with Docker to install a Golang app that starts a server in port 4000 and I’m doing this in my production stage Dockerfile:
EXPOSE 4000
ENTRYPOINT ["./app"] --port 4000
However after running the Dockerfile and making sure the server is running, I want to go to my droplet IP address to make sure it worked, but it just shows the Caddy static website. However, going to the IP:4000 shows my app.
What do I need to do in order to see my web app in the default 80 port? Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
I believe that you need to configure Caddy to reverse proxy requests from port 80 to your Go app on port 4000.
To do that you have to update your Caddy config file and add a reverse proxy rule, eg:
Just replace the
<your-droplet-ip>
with your actual Droplet IP address and then restart Caddy:After that you should be able to access your web app by navigating to your Droplet’s IP address in the browser without specifying port 4000.
For more information on
reverse_proxy
config, you can check the documentation here:Let me know how it goes!
Best,
Bobby