Gitlab relative url under apache proxy

I am running gitlab inside docker which maps to port 8880 on my localhost. So I can access it using the url
http: // localhost: 8880

But I used apache proxy to create the following localhost mapping  
: 8880 ------> localhost / gitlab

So that my users can access gitlab via localhost / gitlab . Everything seems to be working fine, but the problem occurs when the page is rendered. All link in the page generated by Gitlab uses a relative url like

/assets/favicon-baaa14bade1248aa6165e9d34e7d83c0.ico /assets/application-296ff8a0c87574e522a2911224b5350b.css /assets/print-1df3ea9b8ff148a6745321899e0cb213.css

This causes apache to redirect them to localhost / assets / ... when clicked. Which results in a 404 error, which is obvious because the resource path is wrong. The link needs to be generated as localhost / gitlab / assets / .... for apache to map them correctly to localhost / gitlab / assets / ...

I tried using Apache rewrite module, Nginx rewrite module, but none of them worked. Is there anyway I can change the relative url generated by gitlab?

+3


source to share


1 answer


Sorry, this feature is currently not supported in gitlab. If you must use a relative url consider using omnibus gitlab as it supports relative urls.



When you send a request to localhost / gitlab, the correct apache server redirects it to localhost: 8880. But neither gitlab nor nginx knows that it is coming from a relative url, but only apache. This becomes a problem since the resource paths in gitlab are built with fqdn - localhost: 8880. And apache only changes the request header to localhost / gitlab, not the links and resources embedded in the request.

0


source







All Articles