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!