Nginx - Https configuration

About

This article shows you how to configure SSL (https) for the nginx web server

Prerequisites

You should know the basic of SSL for a server: How to enable SSL on a server (ie HTTPS on a web server) ?.

Configuration

When you got:

  • your certificate
  • and the private key

you can configure it 1) like that inside a server block

http {
    ssl_session_cache   shared:SSL:10m;
    ssl_session_timeout 10m;
    
    server {
        listen              443 ssl;
        server_name         www.example.com; # the uri
        ssl_certificate     www.example.com.crt; # the certificate (public)
        ssl_certificate_key www.example.com.key; # the private key
        ssl_protocols       TLSv1 TLSv1.1 TLSv1.2; # the ssl version
        ssl_ciphers         HIGH:!aNULL:!MD5; # the ciphers
        ...
    }
    
}

where:





Discover More
400 Default Page No Required Ssl Certificate
How to configure certification based client authentication with Nginx ?

This article shows you how to configure a client authentication via the ownership of a certificat on a Nginx web server. The server should be already configured for HTTPS as client certificate (client...
Web Site Certificate
How to enable SSL on a server (ie HTTPS on a web server) ?

This page shows you how to configure a certificate and a private key for a server in order to enable SSL or a web server (http) (ie web site) in order to enable https (ie HTTP over SSL).



Share this page:
Follow us:
Task Runner