I’ve tried adding a SRV record, but the form prevents setting the destination to @ (the base host).
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.
@webutek
If you’re running an application that runs on a port other than port 80 or 443 (HTTP and HTTPS), and the application isn’t designed to run on those ports (i.e. most NodeJS apps, for example), then what you’d want to do is setup a proxy. This would essentially accept a request on port 80/443 and then proxy it to the port that your application is running on.
Most DNS providers, other than Amazon, CloudFlare, and potentially Google (not 100% on as I’ve not used their DNS in a while) won’t allow you to point anything other than you domain to root (i.e.
@
).DigitalOcean falls in to that category as of this post (i.e. it’s not allowed).
Using a proxy (i.e. setting up NGINX as a proxy, for example), will allow you to setup a server block such as:
What the above would do is take a request on Port 80, proxy it to the
myapp
backend
block, which sets the ‘server’ to use – in this case, it’d behttp://localhost:2623
, which would be an application that is running on port2623
.You can setup multiple
upstream
blocks to proxy to different applications and you can setup multiplelocation
blocks to handle different paths.For example, we could add:
Create a new location block that uses it at a path other than
/
:Now when a request for
/newpath
is made, it’ll respond with the application running on2624
as per the newupstream
block we just set up.That’s one way of doing it and keeping ports off the URL.
You can’t, your webserver determines that.