18
18
## Make sure to read it and understand what each option does.
19
19
##
20
20
## [Optional] Generate a self-signed ssl certificate:
21
- ## cd /etc/nginx/
22
- ## sudo openssl req -new -x509 -nodes -days 3560 -out gitlab.crt -keyout gitlab.key
23
- ## sudo chmod o-r gitlab.key
21
+ ## mkdir /etc/nginx/ssl/
22
+ ## cd /etc/nginx/ssl/
23
+ ## sudo openssl req -new -x509 -nodes -days 3560 -out gitlab.crt -keyout gitlab.key
24
+ ## sudo chmod o-r gitlab.key
24
25
##
25
26
## Edit `gitlab-shell/config.yml`:
26
27
## 1) Set "gitlab_url" param in `gitlab-shell/config.yml` to `https://git.example.com`
@@ -66,14 +67,16 @@ server {
66
67
## Replace git.example.com with your FQDN.
67
68
server_name git.example.com;
68
69
server_tokens off;
69
- ## this doesn't have to be a valid path since we are redirecting, you don't have to change it.
70
+ ## This doesn't have to be a valid path since we are redirecting,
71
+ ## you don't have to change it.
70
72
root /nowhere;
71
73
rewrite ^ https://$server_name$request_uri permanent;
72
74
}
73
75
74
76
server {
75
77
listen 443 ssl;
76
- server_name git.example.com; # Replace git.example.com with your FQDN.
78
+ ## Replace git.example.com with your FQDN.
79
+ server_name git.example.com;
77
80
server_tokens off;
78
81
root /home/git/gitlab/public;
79
82
@@ -84,17 +87,22 @@ server {
84
87
## Strong SSL Security
85
88
## https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
86
89
ssl on;
87
- ssl_certificate /etc/nginx/gitlab.crt;
88
- ssl_certificate_key /etc/nginx/gitlab.key;
90
+ ssl_certificate /etc/nginx/ssl/ gitlab.crt;
91
+ ssl_certificate_key /etc/nginx/ssl/ gitlab.key;
89
92
90
93
ssl_ciphers 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4';
91
94
92
95
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
93
96
ssl_session_cache builtin:1000 shared:SSL:10m;
94
97
98
+ ## Enable OCSP stapling to reduce the overhead and latency of running SSL.
99
+ ## Replace with your ssl_trusted_certificate. For more info see:
100
+ ## - https://medium.com/devops-programming/4445f4862461
101
+ ## - https://www.ruby-forum.com/topic/4419319
95
102
ssl_stapling on;
96
103
ssl_stapling_verify on;
97
- resolver 8.8.4.4 8.8.8.8 valid=300s;
104
+ ssl_trusted_certificate /etc/nginx/ssl/stapling.trusted.crt;
105
+ resolver 208.67.222.222 208.67.222.220 valid=300s;
98
106
resolver_timeout 10s;
99
107
100
108
ssl_prefer_server_ciphers on;
0 commit comments