Welcome! Log In Create A New Profile

Advanced

location problem with static content

Philipp Kraus
October 29, 2013 02:36PM
Hello,

I have created for my GitLab installation this entries in the configuration:

location /gitlab {
root /home/gitlab/gitlab/public;
try_files $uri $uri/index.html $uri.html @gitlab;
}

location @gitlab {
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;

proxy_pass http://localhost:9080;
}

so I can use GitLab with https://myserver/gitlab, most functions of GitLab works well, but I have got a problem with the static content.
I get this error:

[error] 4573#0: *4 open() "/home/www/static.css" failed (2: No such file or directory)

The message is correct, because the main root dir (above the location) is set to /home/www, so the fallback mechanism works.
But in my case I need a correct rule, that also static content, which have got the /gitlab URL part are mapped into /home/gitlab/gitlab/public

How can I tell my location rule, that static content is stored in the correct root folder?

Thanks

Phil
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

location problem with static content

Philipp Kraus October 29, 2013 02:36PM

Re: location problem with static content

Francis Daly October 29, 2013 04:32PM

Re: location problem with static content

Philipp Kraus October 30, 2013 06:18AM

Re: location problem with static content

Francis Daly October 30, 2013 02:50PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 210
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready