On Wed, Oct 30, 2013 at 11:15:42AM +0100, Philipp Kraus wrote:
Am 29.10.2013 um 21:30 schrieb Francis D. [email protected]:
On Tue, Oct 29, 2013 at 07:34:15PM +0100, Philipp Kraus wrote:
There are a few possible different reasons for things not to be working
the way you want.
The best chance of getting things fixed if is there is clarity about
what was tried and failed.
The best information is of the form “I did A, I got B, but I expected
to get C”.
try_files $uri/ @gitlab;
That’s not what I intended to suggest you do.
try_files $uri $uri/ $uri.html @gitlab;
where the $uri.html part is presumably gitlab-specific.
And “root” vs “alias” depends on what url to filename mapping you want
that does not work also.
So, next time, can you do something like
curl -i http://server/gitlab
and see how what you get differs from what you expect to get?
What I’m guessing is that the file
/home/gitlab/gitlab/public/gitlab/index.html contains something
like . When you access the file via the
url http://server/gitlab, the browser follows the link and asks for
http://server/static.css – which nginx expects to refer to the file
If you use the suggested try_files, then when you access
the url http://server/gitlab, you will be redirected to the
url http://server/gitlab/; when you access that url, you’ll
get the same file content, but now the browser will ask for
http://server/gitlab/static.css, which nginx expects to refer to the
What url did you access to get this message?
What file on the filesystem did you want it to serve for that url?
The message shows:
2013/10/30 11:10:18 [error] 6692#0: *5 open() “/home/www/static.css” failed (2:
No such file or directory), client: , server: ,
request: “GET /static.css HTTP/1.1”, host: “”, referrer:
So, the url is /static.css.
nginx tries to return the file /home/www/static.css.
Which file on the filesystem do you want nginx to return, when it gets
a request for /static.css?
I try to port this configuration
gitlabhq/lib/support/nginx/gitlab at master · gitlabhq/gitlabhq · GitHub
to the subdirectory, so GitLab is not called on https://myserver/ but rather
From the extra log line, I guess that perhaps the file
/home/gitlab/gitlab/public/gitlab/index.html contains instead something
like . If that is the case, then the best
thing you can do if you want to proxy the application “gitlab” behind
the non-root-url /gitlab/, is to configure the application so that it
knows that its root url is /gitlab/, not /.
After you’ve done that, the nginx config should be simpler.
Good luck with it,
Francis D. [email protected]