-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitlabhqNginxConfig
More file actions
33 lines (26 loc) · 915 Bytes
/
gitlabhqNginxConfig
File metadata and controls
33 lines (26 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
upstream gitlabhq {
server unix:/home/gitlabhq/gitlabhq/tmp/sockets/gitlab.socket;
}
server {
listen 80;
server_name gitlab.sparqstudios.com;
root /home/gitlabhq/gitlabhq/public;
# individual nginx logs for this gitlab vhost
access_log /var/log/nginx/gitlabhq_access.log;
error_log /var/log/nginx/gitlabhq_error.log;
location / {
# serve static files from defined root folder;.
# @gitlab is a named location for the upstream fallback, see below
try_files $uri $uri/index.html $uri.html @gitlabhq;
}
# if a file, which is not found in the root folder is requested,
# then the proxy pass the request to the upsteam (gitlab unicorn)
location @gitlabhq {
proxy_redirect off;
# you need to change this to "https", if you set "ssl" directive to "on"
proxy_set_header X-FORWARDED_PROTO http;
proxy_set_header Host gitlab.sparqstudios.com:80;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://gitlabhq;
}
}