Advertisement
Guest User

GitLab Nginx config

a guest
Jul 24th, 2013
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  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. # individual nginx logs for this gitlab vhost
  16. access_log /var/log/nginx/gitlab_access.log;
  17. error_log /var/log/nginx/gitlab_error.log;
  18.  
  19. location / {
  20. # serve static files from defined root folder;.
  21. # @gitlab is a named location for the upstream fallback, see below
  22. try_files $uri $uri/index.html $uri.html @gitlab;
  23. }
  24.  
  25. # if a file, which is not found in the root folder is requested,
  26. # then the proxy pass the request to the upsteam (gitlab unicorn)
  27. location @gitlab {
  28. proxy_read_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
  29. proxy_connect_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
  30. proxy_redirect off;
  31.  
  32. proxy_set_header X-Forwarded-Proto $scheme;
  33. proxy_set_header Host $http_host;
  34. proxy_set_header X-Real-IP $remote_addr;
  35.  
  36. proxy_pass http://gitlab;
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement