Difference between revisions of "Nginx 1.17.0 - OpenSSL 1.1.1"

From wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
Below is a SSL configuration for the nginx web server version 1.17.0, using OpenSSL version 1.1.1. This configuration file was generated by the [https://ssl-config.mozilla.org/ Mozilla SSL Configuration Generator.]
 
Below is a SSL configuration for the nginx web server version 1.17.0, using OpenSSL version 1.1.1. This configuration file was generated by the [https://ssl-config.mozilla.org/ Mozilla SSL Configuration Generator.]
 
<pre>
 
<pre>
 +
  
 
# generated 2019-09-09, https://ssl-config.mozilla.org/#server=nginx&server-version=1.17.0&config=intermediate&openssl-version=1.1.1
 
# generated 2019-09-09, https://ssl-config.mozilla.org/#server=nginx&server-version=1.17.0&config=intermediate&openssl-version=1.1.1
Line 6: Line 7:
 
      
 
      
 
listen 80 default_server;
 
listen 80 default_server;
     listen [::]:80 default_server;
+
      
 +
listen [::]:80 default_server;
  
 
     # redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
 
     # redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
Line 14: Line 16:
  
 
server {
 
server {
 +
 +
listen 443 ssl http2;
 
      
 
      
listen 443 ssl http2;
+
listen [::]:443 ssl http2;
    listen [::]:443 ssl http2;
 
  
 
     # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate
 
     # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate
Line 30: Line 33:
 
     # intermediate configuration
 
     # intermediate configuration
 
     ssl_protocols TLSv1.2 TLSv1.3;
 
     ssl_protocols TLSv1.2 TLSv1.3;
     ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-  
+
     ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20- POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
    AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
 
 
     ssl_prefer_server_ciphers off;
 
     ssl_prefer_server_ciphers off;
 
+
 
 
     # HSTS (ngx_http_headers_module is required) (63072000 seconds)
 
     # HSTS (ngx_http_headers_module is required) (63072000 seconds)
 
     add_header Strict-Transport-Security "max-age=63072000" always;
 
     add_header Strict-Transport-Security "max-age=63072000" always;

Revision as of 10:16, 24 September 2019

Below is a SSL configuration for the nginx web server version 1.17.0, using OpenSSL version 1.1.1. This configuration file was generated by the Mozilla SSL Configuration Generator.



# generated 2019-09-09, https://ssl-config.mozilla.org/#server=nginx&server-version=1.17.0&config=intermediate&openssl-version=1.1.1
server {
    
listen 80 default_server;
    
listen [::]:80 default_server;

    # redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
    return 301 https://$host$request_uri;

}

server {

listen 443 ssl http2;
    
listen [::]:443 ssl http2;

    # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate
    ssl_certificate /path/to/signed_cert_plus_intermediates;
    ssl_certificate_key /path/to/private_key;
    ssl_session_timeout 1d;
    ssl_session_cache shared:MozSSL:10m;  # about 40000 sessions
    ssl_session_tickets off;

    # curl https://ssl-config.mozilla.org/ffdhe2048.txt > /path/to/dhparam.pem
    ssl_dhparam /path/to/dhparam.pem;

    # intermediate configuration
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20- POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
    ssl_prefer_server_ciphers off;
  
    # HSTS (ngx_http_headers_module is required) (63072000 seconds)
    add_header Strict-Transport-Security "max-age=63072000" always;

    # OCSP stapling
    ssl_stapling on;
    ssl_stapling_verify on;

    # verify chain of trust of OCSP response using Root CA and Intermediate certs
    ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates;

    # replace with the IP address of your resolver
    resolver 127.0.0.1;

}