Hello, I have a simple Bottle.py python app inside a docker container that exposes port 8081. If I visit my.droplet.ip:8081 the app shows up. Now, I want the app to be on sub.mydomain.tld. Please note that I am running Apache2 and mydomain.tld is not hosted on my droplet. How may I approach the problem?
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.
@abhisekdutta
What you need to do is setup proxying. This can be done with Apache using
mod_proxy
and there’s a guide for exactly that here at DigitalOcean.https://www.digitalocean.com/community/tutorials/how-to-use-apache-as-a-reverse-proxy-with-mod_proxy-on-ubuntu-16-04
Without using a proxy, which internally accepts requests for
domain.com
orsub.domain.com
and servesdomain.com:2365
(or any application running on a port, just an example), you’d need to keep the ports in the URL’s.You create an A-Record in your DNS panel that points to the desired IP address.