Nginx server configuration HTTPS nginx.config configuration file of tutorial

  • 2020-05-14 05:58:33
  • OfStack

Directory location:

/ usr/local/www nginx/conf (for reference only)


 server {
  listen    443 ssl;
  server_name localhost;
  ssl_certificate  server.crt; # cert.pem;
  ssl_certificate_key server.key; # cert.key;
  ssl_session_cache  shared:SSL:1m;
  ssl_session_timeout 5m;
  ssl_ciphers HIGH:!aNULL:!MD5;
  ssl_prefer_server_ciphers on;
  location / {
    root  /home/share;
    autoindex on;
    index index.html index.htm;
  }
}

These are the company servers

The Nginx can be re-read after the configuration file is detected to be ok


nginx -t && nginx -s reload
1 listen 443;  Listening to the 443 port 
2 ssl on;  open SSL The module 
3 ssl_protocols SSLv2 SSLv3 TLSv1;  The specified SSL Use agreement 
4 ssl_ciphers HIGH:!aNULL:!MD5;  Specify encryption mode 
5 ssl_prefer_server_ciphers on;  Configuration depends on SSLv3 and TLSv1 The server password for the protocol will take precedence over the client password 
6 ssl_session_timeout 10m;  Set the session timeout 
7 ssl_certificate xxx.cer;  Certificate of configuration 
8 ssl_certificate_key xxx.key;  Configuration keys 

Related articles: