У меня такой конфиг nginx:
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 - мой второй сервер с Gitlab. поэтому, когда я сижу на http: // server1 / git Я получаю свой gitlab.
Проблема в том, что все файлы .pngs, .ttf и .woff не могут быть найдены. И это потому, что он внезапно удаляет / git / из пути: http://server1/assets/SourceSansPro-Regular-60f619fe2b3b48b193b9047abd7f8872.ttf Failed to load resource: the server
но я установил свой GITLAB_RELATIVE_URL_ROOT в / git / при установке Gitlab.
Почему это происходит? Как я могу получить эти изображения?
Спасибо! :)
РЕДАКТИРОВАТЬ: я нашел обходной путь, переписав отсутствующие запросы
#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;
}
Это работает для меня, но не решает саму проблему!