88# You need from run openssl to generate the ssl certificate.
99# $ sudo openssl req -new -x509 -nodes -days 3560 -out gitlab.crt -keyout gitlab.key
1010# $ sudo chmod o-r gitlab.key
11-
11+
1212upstream gitlab {
1313 server unix:/home/gitlab/gitlab/tmp/sockets/gitlab.socket;
1414}
@@ -17,43 +17,45 @@ upstream gitlab {
1717server {
1818 listen 80;
1919 server_name Domain_NAME;
20+ server_tokens off;
2021 root /nowhere;
2122 rewrite ^ https://gitlab.stardrad.com$request_uri permanent;
2223}
2324server {
2425 listen 443;
2526 server_name Domain_NAME;
27+ server_tokens off;
2628 root /home/gitlab/gitlab/public;
27-
29+
2830 ssl on;
2931 ssl_certificate gitlab.crt;
30- ssl_certificate_key gitlab.key;
31- ssl_protocols SSLv3 TLSv1 TLSv2;
32- ssl_ciphers AES:HIGH:!ADH:!MD5;
33- ssl_prefer_server_ciphers on;
34-
32+ ssl_certificate_key gitlab.key;
33+ ssl_protocols SSLv3 TLSv1 TLSv2;
34+ ssl_ciphers AES:HIGH:!ADH:!MD5;
35+ ssl_prefer_server_ciphers on;
36+
3537 # individual nginx logs for this gitlab vhost
3638 access_log /var/log/nginx/gitlab_access.log;
3739 error_log /var/log/nginx/gitlab_error.log;
38-
40+
3941 location / {
4042 # serve static files from defined root folder;.
4143 # @gitlab is a named location for the upstream fallback, see below
4244 try_files $uri $uri/index.html $uri.html @gitlab;
4345 }
44-
46+
4547 # if a file, which is not found in the root folder is requested,
4648 # then the proxy pass the request to the upsteam (gitlab unicorn)
4749 location @gitlab {
4850 proxy_read_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
4951 proxy_connect_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
5052 proxy_redirect off;
51-
53+
5254 proxy_set_header X-Forwarded-Proto https;
5355 proxy_set_header X-Forwarded-Ssl on;
5456 proxy_set_header Host $http_host;
5557 proxy_set_header X-Real-IP $remote_addr;
56-
58+
5759 proxy_pass http://gitlab;
5860 }
5961}
0 commit comments