【问题标题】:TFS behind Nginx reverse proxyNginx 反向代理背后的 TFS
【发布时间】:2018-03-22 15:17:21
【问题描述】:

尝试在 Nginx 反向代理后面配置 Team Foundation Server。 另外,我使用的是自签名 SSL 证书。

获取ERR_TOO_MANY_REDIRECTS

这是我的 nginx 配置:

server {
    listen 80 default;
    server_name tfs.domain.com;
    return 301 https://$host$request_uri;    
}

upstream tfs.domain.com {
        server 12.34.56.78:80; #local tfs address
        keepalive 16;
}

server {
    listen 443 ssl;
    server_name tfs.domain.com;

    ssl_certificate /etc/nginx/ssl/tfs.domain.com.pem;
    ssl_certificate_key /etc/nginx/ssl/tfs.domain.com.key;
    ssl_session_cache shared:SSL:10m;

    ssl_session_timeout 5m;

    ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
    ssl_prefer_server_ciphers on;

    location / {
        proxy_pass http://12.34.56.78:80; #local tfs address
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_redirect http:// $scheme://;

    }
    access_log /var/log/nginx/tfs.domain.com/443-access.log;
    error_log /var/log/nginx/tfs.domain.com/443-error.log;
}

我做错了什么?

【问题讨论】:

    标签: nginx tfs ssl-certificate reverse-proxy


    【解决方案1】:

    尝试明确设置proxy_redirect

    例如:

    proxy_redirect  http://localhost:8080 https://tfs.domain.com;
    

    你可以参考下面的文章来配置nginx(应该和TFS类似):

    How To Configure Nginx with SSL as a Reverse Proxy for Jenkins

    这个帖子可能会有所帮助:https://serverfault.com/questions/754351/what-is-a-correct-ways-to-allow-login-to-an-iis-site-through-a-reverse-proxy

    此外,您可以参考以下文章来解决ERR_TOO_MANY_REDIRECTS 问题:

    【讨论】:

    • @Leonid Usachov 你解决了这个问题吗?有更新吗?
    猜你喜欢
    • 2019-03-14
    • 2021-04-01
    • 1970-01-01
    • 2017-08-14
    • 2022-06-23
    • 1970-01-01
    • 2012-02-04
    • 2019-08-31
    • 1970-01-01
    相关资源
    最近更新 更多