Dns record pointing to a port

If I have a server which had public side on port 8080 and admin site on 8081. How do I set up dns record to only point to port 8080. AFAIK you can't specify port on dns record.
2 Replies
tala⸆⸉
tala⸆⸉3mo ago
loooks like you need to setup something like nginx
Chaika
Chaika3mo ago
You're right, DNS doesn't care about ports. You have a few different options. 1.You can use alternant ports as supported by Cloudflare here: https://developers.cloudflare.com/fundamentals/reference/network-ports/, but that would require the user to visit your site on https://example.com:8443 for example 2. You can use Origin Rules to transparently override the destination port: https://developers.cloudflare.com/rules/origin-rules/. So https://example.com (no added port, so default is 443) would go to 8443 or whatever port you overwrite it to. 8080 is an http/plaintext port. If you were actually wanting to use plaintext http, use https with Cloudflare's Origin Certificates instead: https://developers.cloudflare.com/ssl/origin-configuration/origin-ca/, they last for up to 15 years and work with Full (Strict), and you're encrypting from CF -> Origin
Cloudflare Docs
Origin Rules · Cloudflare Rules docs
Origin Rules allow you to customize where the incoming traffic will go and with which parameters. Currently you can perform the following overrides:
Want results from more Discord servers?
Add your server