【问题标题】:Hosting subdomain with digital ocean and bluehost使用数字海洋和 bluehost 托管子域
【发布时间】:2017-01-31 08:23:38
【问题描述】:

我的域在 bluehost 上,但我的后端在数字海洋上。我需要将 admin.mydomain.com 分配给 12.12.122.1:3000 可以说。

我应该怎么做,还有其他方法吗?

【问题讨论】:

  • 告诉我们一些关于您的后端技术的详细信息以及您迄今为止所尝试的内容。
  • 我的后端是用 node js 构建的,我不能在 bluehost 上托管它。我尝试的是重定向,但这不是我想要的

标签: node.js dns


【解决方案1】:

先将域添加到您的 Digital Ocean 帐户,然后在您的服务器上安装 nginx

并使用nginx 将您的请求转发到节点:

server {
    listen 80;

    server_name example.com;

    location / {
        proxy_pass 12.12.122.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

【讨论】:

  • 它是一个客户网站,他使用 bluehost,我认为他可能不想迁移
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-08-27
  • 1970-01-01
  • 1970-01-01
  • 2019-09-30
  • 1970-01-01
  • 2019-11-08
  • 1970-01-01
相关资源
最近更新 更多