1

I have the following nginx config:

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

    root /usr/share/nginx/html;
    index index.php index.html index.htm;

    location /git {
      proxy_pass  http://134.103.176.101:10080;
      include proxy_params;
    }
}

134.103.176.101 is my second server with Gitlab hosted. so when I surf on http://server1/git I get my gitlab.

The Problem is, that all .pngs .ttf and .woff files cant be found. And thats because he suddenly removes the /git/ from the path: http://server1/assets/SourceSansPro-Regular-60f619fe2b3b48b193b9047abd7f8872.ttf Failed to load resource: the server

but I have set my GITLAB_RELATIVE_URL_ROOT to /git/ at my Gitlab installation.

Why is this happening? How can I get this Images ?

Thanks! :)


EDIT: I've found a workaround by rewriting missing requests

#Rewrites the request, extracting a fragment of the file name and using a remote server.
    location @fetchFromRemote {
        rewrite ^/assets/(.*)$ server1/git/assets/$1 redirect;
    }

    #Will try to see if we have the file in this server, is not will use fetchFromRemote
    location ~ ^/assets/.*(png|jpg|jpeg|gif|ico|swf|ttf|woff|woff2)$ {
        try_files $uri @fetchFromRemote;
    }

This works for me but not solve the problem itself!

Cracker0dks
  • 113
  • 1
  • 6
  • You haven't described your problem or configuration very well, or how the setup is different from the working server. One idea, which is really just a stab in the dark because of lack of information : what happens if you change your proxy pass to proxy_pass http://134.103.176.101:10080/git ? – Tim Jan 13 '16 at 00:33
  • no, that will no work. I want to point server1/git:80 -> server2:10080. Thats all. But Images not found (Page itself works perfect!). Hope you understand now ? – Cracker0dks Jan 14 '16 at 20:10
  • Can you please tell which version of Gitlab did you install and how ? Also on which operating system, just in case. – Pierre-Alain TORET Jan 15 '16 at 13:59
  • yeah its this docker installation: https://github.com/sameersbn/docker-gitlab. Docker is running on Ubuntu. – Cracker0dks Jan 15 '16 at 14:53

0 Answers0