2015-12-17 13:25:28 -05:00
|
|
|
## GitLab
|
|
|
|
##
|
|
|
|
|
2015-11-03 15:28:07 -05:00
|
|
|
## Pages serving host
|
|
|
|
server {
|
|
|
|
listen 0.0.0.0:80;
|
|
|
|
listen [::]:80 ipv6only=on;
|
|
|
|
|
|
|
|
## Replace this with something like pages.gitlab.com
|
2015-12-17 13:25:28 -05:00
|
|
|
server_name *.YOUR_GITLAB_PAGES.DOMAIN;
|
|
|
|
root /home/git/gitlab/shared/pages/${host};
|
2015-11-03 15:28:07 -05:00
|
|
|
|
|
|
|
## Individual nginx logs for GitLab pages
|
|
|
|
access_log /var/log/nginx/gitlab_pages_access.log;
|
|
|
|
error_log /var/log/nginx/gitlab_pages_error.log;
|
|
|
|
|
2015-12-17 13:25:28 -05:00
|
|
|
# 1. Try to get /project/ from => shared/pages/${host}/${project}/public/
|
|
|
|
# 2. Try to get / from => shared/pages/${host}/${host}/public/
|
2015-11-03 15:28:07 -05:00
|
|
|
location ~ ^/([^/]*)(/.*)?$ {
|
|
|
|
try_files "/$1/public$2"
|
|
|
|
"/$1/public$2/index.html"
|
|
|
|
"/${host}/public/${uri}"
|
|
|
|
"/${host}/public/${uri}/index.html"
|
|
|
|
=404;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Define custom error pages
|
|
|
|
error_page 403 /403.html;
|
|
|
|
error_page 404 /404.html;
|
|
|
|
}
|