OSDN Git Service

More explanation for upload limits.
[wvm/gitlab.git] / lib / support / nginx / gitlab
1 # GITLAB
2 # Maintainer: @randx
3 # App Version: 5.0
4
5 upstream gitlab {
6   server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
7 }
8
9 server {
10   listen *:80 default_server;         # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea
11   server_name YOUR_SERVER_FQDN;     # e.g., server_name source.example.com;
12   server_tokens off;     # don't show the version number, a security best practice
13   root /home/git/gitlab/public;
14   
15   # Set value of client_max_body_size to at least the value of git.max_size in gitlab.yml
16   # Also increase this if you want to upload large attachments
17   client_max_body_size 5m;
18
19   # individual nginx logs for this gitlab vhost
20   access_log  /var/log/nginx/gitlab_access.log;
21   error_log   /var/log/nginx/gitlab_error.log;
22
23   location / {
24     # serve static files from defined root folder;.
25     # @gitlab is a named location for the upstream fallback, see below
26     try_files $uri $uri/index.html $uri.html @gitlab;
27   }
28
29   # if a file, which is not found in the root folder is requested,
30   # then the proxy pass the request to the upsteam (gitlab unicorn)
31   location @gitlab {
32     proxy_read_timeout 300; # Some requests take more than 30 seconds.
33     proxy_connect_timeout 300; # Some requests take more than 30 seconds.
34     proxy_redirect     off;
35
36     proxy_set_header   X-Forwarded-Proto $scheme;
37     proxy_set_header   Host              $http_host;
38     proxy_set_header   X-Real-IP         $remote_addr;
39     proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;
40
41     proxy_pass http://gitlab;
42   }
43 }
44