Skip to content

Commit de832b3

Browse files
committed
updates and fixes
1 parent 59ff6a0 commit de832b3

File tree

1 file changed

+25
-62
lines changed

1 file changed

+25
-62
lines changed

source/install/config-ssl-http2-nginx.rst

Lines changed: 25 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Although you can configure HTTP/2 without SSL, both Firefox and Chrome browsers
99

1010
You can use any certificate that you want, but these instructions show you how to download and install certificates from *Let's Encrypt*.
1111

12+
**To SSL and HTTP/2:**
13+
1214
1. Log into the server that hosts NGINX and open a terminal window.
1315
2. Install git.
1416

@@ -43,73 +45,32 @@ You can use any certificate that you want, but these instructions show you how t
4345

4446
When prompted, enter your domain name. The certificate is located in ``/etc/letsencrypt/live``
4547

46-
8. Open the file ``/etc/nginx/sites-available/mattermost`` as root in a text editor and update it to incorporate the following lines. Make sure that you use your own values for the Mattermost server IP address and FQDN for *server_name*.
48+
8. Open the file ``/etc/nginx/sites-available/mattermost`` as root in a text editor and update the *server* section to incorporate the highlighted lines in the following sample. Make sure to replace {domain-name} with your own domain name, in 2 places.
4749

4850
.. code-block:: none
51+
:emphasize-lines: 5,9-16
4952
50-
upstream backend {
51-
server 10.10.10.2:8065;
52-
}
53-
53+
.
54+
.
55+
.
5456
server {
55-
listen 80;
56-
server_name mattermost.example.com;
57-
return 301 https://$server_name$request_uri;
57+
listen 443 ssl http2;
58+
.
59+
.
60+
.
61+
ssl on;
62+
ssl_certificate /etc/letsencrypt/live/{domain-name}/fullchain.pem;
63+
ssl_certificate_key /etc/letsencrypt/live/{domain-name}/privkey.pem;
64+
ssl_session_timeout 5m;
65+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
66+
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
67+
ssl_prefer_server_ciphers on;
68+
ssl_session_cache shared:SSL:10m;
69+
.
70+
.
71+
.
5872
}
5973
60-
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=mattermost_cache:10m max_size=3g inactive=120m use_temp_path=off;
61-
62-
server {
63-
listen 443 ssl http2;
64-
server_name mattermost.example.com;
65-
66-
ssl on;
67-
ssl_certificate /etc/letsencrypt/live/yourdomainname/fullchain.pem;
68-
ssl_certificate_key /etc/letsencrypt/live/yourdomainname/privkey.pem;
69-
ssl_session_timeout 5m;
70-
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
71-
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
72-
ssl_prefer_server_ciphers on;
73-
ssl_session_cache shared:SSL:10m;
74-
75-
location /api/v3/users/websocket {
76-
proxy_set_header Upgrade $http_upgrade;
77-
proxy_set_header Connection "upgrade";
78-
proxy_set_header X-Forwarded-Ssl on;
79-
client_max_body_size 50M;
80-
proxy_set_header Host $http_host;
81-
proxy_set_header X-Real-IP $remote_addr;
82-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
83-
proxy_set_header X-Forwarded-Proto $scheme;
84-
proxy_set_header X-Frame-Options SAMEORIGIN;
85-
proxy_buffers 256 16k;
86-
proxy_buffer_size 16k;
87-
proxy_read_timeout 600s;
88-
proxy_pass http://backend;
89-
}
90-
91-
location / {
92-
proxy_set_header X-Forwarded-Ssl on;
93-
client_max_body_size 50M;
94-
proxy_set_header Connection "";
95-
proxy_set_header Host $http_host;
96-
proxy_set_header X-Real-IP $remote_addr;
97-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
98-
proxy_set_header X-Forwarded-Proto $scheme;
99-
proxy_set_header X-Frame-Options SAMEORIGIN;
100-
proxy_buffers 256 16k;
101-
proxy_buffer_size 16k;
102-
proxy_read_timeout 600s;
103-
proxy_cache mattermost_cache;
104-
proxy_cache_revalidate on;
105-
proxy_cache_min_uses 2;
106-
proxy_cache_use_stale timeout;
107-
proxy_cache_lock on;
108-
proxy_pass http://backend;
109-
}
110-
}
111-
112-
11374
9. Restart NGINX
11475

11576
On Ubuntu 14.04 and RHEL 6.6:
@@ -118,7 +79,7 @@ You can use any certificate that you want, but these instructions show you how t
11879

11980
On Ubuntu 16.04 and RHEL 7.1:
12081

121-
``sudo systemctl start nginx``
82+
``sudo systemctl start nginx``
12283

12384
10. Check that your SSL certificate is set up correctly.
12485

@@ -132,3 +93,5 @@ You can use any certificate that you want, but these instructions show you how t
13293
In the following line, use your domain name in place of *<domain-name>*
13394

13495
``@monthly /home/ubuntu/letsencrypt/letsencrypt-auto certonly --reinstall --nginx -d <domain-name> && sudo service nginx reload``
96+
97+
8. Check that your SSL certificate is set up correctly. Test the SSL certificate by visiting a site such as https://www.ssllabs.com/ssltest/index.html. If there’s an error about the missing chain or certificate path, there is likely an intermediate certificate missing that needs to be included.

0 commit comments

Comments
 (0)