# GITLAB CI
server {
  listen 80;                        # e.g., listen 192.168.1.1:80;
  server_name {{GITLAB_CI_HOST}};   # e.g., server_name source.example.com;

  access_log  {{GITLAB_LOG_DIR}}/nginx/gitlab_ci_access.log;
  error_log   {{GITLAB_LOG_DIR}}/nginx/gitlab_ci_error.log;

  # expose API to fix runners
  location /api {
    proxy_read_timeout    300;
    proxy_connect_timeout 300;
    proxy_redirect        off;
    proxy_set_header      X-Real-IP $remote_addr;

    resolver {{DNS_RESOLVERS}};
    proxy_pass $scheme://{{GITLAB_HOST}}/ci$request_uri;
  }

  # redirect all other CI requests
  location / {
    return 301 $scheme://{{GITLAB_HOST}}/ci$request_uri;
  }

  # adjust this to match the largest build log your runners might submit,
  # set to 0 to disable limit
  client_max_body_size 0;
}
