spacepaste

  1.  
  2. upstream gitlab-workhorse {
  3. server unix:/home/git/gitlab/tmp/sockets/gitlab-workhorse.socket fail_timeout=0;
  4. }
  5. ## Redirects all HTTP traffic to the HTTPS host
  6. server {
  7. listen 0.0.0.0:80;
  8. listen [::]:80 ipv6only=on default_server;
  9. server_name FQDN;
  10. server_tokens off;
  11. return 301 https://$http_host$request_uri;
  12. access_log /var/log/nginx/gitlab_access.log;
  13. error_log /var/log/nginx/gitlab_error.log;
  14. }
  15. ## HTTPS host
  16. server {
  17. listen 0.0.0.0:443 ssl;
  18. listen [::]:443 ipv6only=on ssl default_server;
  19. server_name FQDN;
  20. server_tokens off;
  21. ## Strong SSL Security
  22. ## https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html & https://cipherli.st/
  23. ssl on;
  24. ssl_certificate /etc/nginx/ssl/FQDN.crt;
  25. ssl_certificate_key /etc/nginx/ssl/FQDN.key;
  26. ssl_trusted_certificate /etc/nginx/ssl/FQDN.ca;
  27. # GitLab needs backwards compatible ciphers to retain compatibility with Java IDEs
  28. ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
  29. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  30. ssl_prefer_server_ciphers on;
  31. ssl_session_cache shared:SSL:10m;
  32. ssl_session_timeout 5m;
  33. ## See app/controllers/application_controller.rb for headers set
  34. access_log /var/log/nginx/gitlab_access.log;
  35. error_log /var/log/nginx/gitlab_error.log;
  36. include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
  37. location / {
  38. client_max_body_size 0;
  39. gzip off;
  40. proxy_read_timeout 300;
  41. proxy_connect_timeout 300;
  42. proxy_redirect off;
  43. proxy_http_version 1.1;
  44. proxy_set_header Host $http_host;
  45. proxy_set_header X-Real-IP $remote_addr;
  46. proxy_set_header X-Forwarded-Ssl on;
  47. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  48. proxy_set_header X-Forwarded-Proto $scheme;
  49. #proxy_set_header X-Forwarded-Proto https;
  50. proxy_pass http://gitlab-workhorse;
  51. }
  52. error_page 404 /404.html;
  53. error_page 422 /422.html;
  54. error_page 500 /500.html;
  55. error_page 502 /502.html;
  56. error_page 503 /503.html;
  57. location ~ ^/(404|422|500|502|503)\.html$ {
  58. root /home/git/gitlab/public;
  59. internal;
  60. }
  61. }
  62.