大网数据广告活动
服务器运维问答

My DNS record can only point to an IP address. How do I make it reach for a port?

· 52CE 我爱测

I am fairly new to network administration and therefore am already excited to have successfully set up a DNS record. Now I am a bit confused, because I would like to have this URL: http://www.example.org:8080/fetch/characters/ be…

问题原文

原帖链接 · xetra11 · CC BY-SA 4.0

I am fairly new to network administration and therefore am already excited to have successfully set up a DNS record.

Now I am a bit confused, because I would like to have this URL:

http://www.example.org:8080/fetch/characters/

be actually reached by this

http://www.example.org/fetch/characters/

So users can reach the service on port 8080 without having to explicitly set the port.

How can I do this? Do I need some special application on my server? Or any redirect stuff to be applied to requests?

已采纳解答

原帖链接 · Sven · CC BY-SA 4.0

DNS records can't point to ports (with a few special case exceptions that do not apply here).

If you have a web service listen on port 8080 and want to reach it without specifying this port, you have 3 options:

  • Make it actually listening on port 80 (or 443 with https).
  • Configure whatever is already listening on port 80 to forward requests to your service on port 8080 (reverse proxy).
  • If you can live with a redirect, use this instead of a proxy, but then your clients will see the :8080 part in their address bars after the redirect.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-11-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。