映射到子域到localhost URL

时间:2012-10-07 10:53:50

标签: dns windows-server-2008 subdomain redmine bitnami

我无法弄清楚如何将subdomain.domain.com指向这个可以从localhost http://localhost:5200/redmine/访问的网址的孩子。

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

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

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

任何提示/指南都会更好,如何继续这样做。

1 个答案:

答案 0 :(得分:1)

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

您有两种选择:

  1. 让您的redmine安装在端口80上响应,并直接为传入的请求提供服务。
  2. 使用反向代理将端口80上的传入请求转发到redmine在端口5200上运行。
  3. 如果您的Web服务器已经侦听端口80,则无法执行选项1.

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

    我从未使用IIS as a reverse proxy,但我确信可以设置relatively easily。在IIS6上,我建议IIRF可以进行反向代理。

    否则您也可以使用apache作为反向代理,并且您可以考虑使用多个redmine实例以及提供静态内容 >积极的缓存标头。这是一个示例apache配置(来自here):

    <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>
    
相关问题