1

我无法弄清楚如何将 subdomain.domain.com 指向这个可以从本地主机访问的 url 的孩子,http://localhost:5200/redmine/.

我已将它安装在 Windows 2008 R2 服务器上,并希望使用 subdomain.domain.com 访问它

我知道如何将子域指向服务器 IP 地址,但不确定如何将此子域请求绑定到特定的应用程序 URL?

请注意,我已经使用 Bitnami 堆栈安装了 redmine。

任何提示/指南都会更好地处理这个问题。

4

1 回答 1

0

这实际上不是关于 DNS,而是关于如何让在自定义端口上运行的应用程序在端口 80 上响应。

你有两个选择:

  1. 让您的 redmine 安装响应端口 80 并直接处理传入请求。
  2. 使用反向代理将端口 80 上的传入请求转发到端口 5200 上运行的 redmine。

如果您的 Web 服务器已经侦听端口 80,则选项 1 不可行。

对于选项 2,应为subdomain.domain.com的 DNS 条目配置服务器的公共 IP 地址。在您的 Web 服务器上,您应该有一个(空)网站响应子域。

我从未将IIS 用作反向代理,但我确信这可以相对容易地设置。在 IIS6 上,我推荐可以做反向代理的IIRF 。

否则,您也可以使用 apache 作为反向代理,并且您可以考虑启动多个 redmine 实例以及直接从具有激进缓存标头的网络服务器提供静态内容。这是一个示例 apache 配置(来自这里):

<VirtualHost *:8080>
    ServerAdmin admin@domain.local
    ServerName redmine.domain.local

    DocumentRoot "C:/redminepath/public"

    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>
    <Proxy balancer://redmine_cluster>
        BalancerMember http://127.0.0.1:8081
        BalancerMember http://127.0.0.1:8082
        BalancerMember http://127.0.0.1:8083
    </Proxy>
    ProxyPreserveHost On

    <DirectoryMatch "/(javascripts|images|stylesheets|plugin_assets|themes)">
        <FilesMatch "\.(ico|pdf|flv|jpe?g|png|gif|js|css|swf)$">
            ExpiresActive On
            ExpiresDefault "access plus 1 month"
        </FilesMatch>
    </DirectoryMatch>
    <FilesMatch "favicon\.ico$">
        ExpiresActive On
        ExpiresDefault "access plus 1 month"
    </FilesMatch>

    # Let apache serve the static content
    ProxyPass /images !
    ProxyPass /stylesheets !
    ProxyPass /javascripts !
    ProxyPass /favicon.ico !
    ProxyPass /plugin_assets !
    ProxyPass /themes !

    # Proxy all other requests
    ProxyPass / balancer://redmine_cluster/
    ProxyPassReverse / balancer://redmine_cluster/
</VirtualHost>
于 2012-10-07T17:08:59.943 回答