简体   繁体   English

将域名指向带有端口号的 IP 地址

[英]To point domain name to IP address with port number

I have created one domain example.com from Freenom domain service.我从 Freenom 域服务创建了一个域 example.com。 I have one Ubuntu server on AWS with valid IP address.我在 AWS 上有一台具有有效 IP 地址的 Ubuntu 服务器。 In Ubuntu server installed Apache server and running one web application.在 Ubuntu 服务器上安装了 Apache 服务器并运行了一个 Web 应用程序。 When i hit the IP address with port number 8080 then it redirect to web application login panel.当我点击端口号为 8080 的 IP 地址时,它会重定向到 Web 应用程序登录面板。 As same i should do that when i hit the domain name it should redirect to web application login panel.同样,当我点击域名时,我应该这样做,它应该重定向到 Web 应用程序登录面板。 I have to create dummy domain for this server IP.我必须为此服务器 IP 创建虚拟域。 I want to point example.com to IP address with port number 8080. From wherever hit the example.com then it should redirect to my server.我想将 example.com 指向端口号为 8080 的 IP 地址。从任何地方点击 example.com 然后它应该重定向到我的服务器。 How to point domain name to IP address ?.如何将域名指向IP地址?。 Still now i created free domain example.com from Freenom domain service.现在我从 Freenom 域服务创建了免费域 example.com。 So what are the steps to be done for my requirement?.那么针对我的要求需要执行哪些步骤? Please let me know if any one know the steps to point domain name to IP address?请让我知道是否有人知道将域名指向IP地址的步骤?

You can create a A record in your dns host provider which points example.com to IP address and add a url redirection in your web server which redirects example.com to example.com:8080 or simply serve your web through port 80.您可以在您的 dns 主机提供商中创建一个 A 记录,该记录将example.com指向IP address并在您的 Web 服务器中添加一个 url 重定向,将 example.com 重定向到 example.com:8080 或简单地通过端口 80 为您的 Web 提供服务。

Or another way : you can use aws s3 to redirect .或者另一种方式:您可以使用aws s3 重定向

First you have to point the domain name to your AWS server.首先,您必须将域名指向您的 AWS 服务器。 Then create nginx virtual block for the domain and set it to proxy all requests to the application.然后为域创建 nginx 虚拟块并将其设置为代理对应用程序的所有请求。

Basically, you need the following virtual block:基本上,您需要以下虚拟块:

server {
  listen 80;
  server_name example.com;

  location / {
    proxy_pass http://127.0.0.1:8080/;
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM