3

我成功安装了 Gitlab 5.3,一切正常。我想在我设法做的 nginx 反向代理后面运行服务器,但所有资产都丢失了:

Gitlab首页

我在 /git 上运行了 Gitlab,这是我的反向代理服务器上的 nginx 配置:

server {
    listen      80 default;
    listen      [::]:80 ipv6only=on default;

    server_name     reverseproxy;
    ## redirect http to https
    rewrite     ^ https://$server_name$request_uri? permanent;

}

server {
    access_log  /var/log/nginx/ssl_access.log;
    error_log   /var/log/nginx/ssl_error.log;
    index index.html index.htm index.php;

    ## start ssl config
    listen 443; 
    server_name reverseproxy;


    ## ssl server specifics 
    ssl on;
    ssl_certificate     /root/reverseproxy/reverseproxy.crt;
    ssl_certificate_key     /root/reverseproxy/reverseproxy.key;

    ssl_session_cache   shared:SSK:10m;
    ssl_session_timeout     10m;

    ssl_protocols SSLv3 TLSv1;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
    ssl_prefer_server_ciphers on;

    location /git {
        proxy_pass      http://gitlabserver/git;

        proxy_redirect off;
        proxy_set_header Host           $host;
        proxy_set_header X-Real-IP      $remote_addr;
        proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;

        proxy_set_header X-Forwarded-Proto  $scheme;
    }       
}

我查看了 nginx 访问和错误日​​志,但没有任何线索。任何提示都非常感谢。

4

1 回答 1

0

假设 git 守护进程和 nginx 守护进程在同一个盒子上,我认为 location 块应该如下所示:

location ^~ /git/ {
    proxy_pass                          http://127.0.0.1/git;
    proxy_redirect                      http://127.0.0.1/git/  /git;
    proxy_set_header Host               $host;
    proxy_set_header X-Real-IP          $remote_addr;
    proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto  $scheme;
}
于 2013-09-20T13:02:05.773 回答