Answer the question
In order to leave comments, you need to log in
Setting up https on nginx?
Please give me a specific example of how to set up https on nginx.
With a description- do it-> get it. I did not find, oddly enough, everything is very confusing. What to do with certificates and can they be done for free?
In general, for a beginner in encryption, tell me in parts.
Thanks
Answer the question
In order to leave comments, you need to log in
The following is sufficient:
server {
listen 443 ssl http2;
server_name домен_здесь;
ssl_certificate /путь/к/сертификату;
ssl_certificate_key /путь/к/ключу;
тут ваш location {}
}
server {
listen 80;
server_name домен_здесь;
return 301 https://$server_name$request_uri;
}
/etc/nginx/conf.d/tls.conf
put in quite strict settings for myself without old protocols and weak ciphers, which are as secure as possible, but only work in current versions of browsers (IE9-10, ancient Firefox, Chrome and Safari may not work at all):ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_dhparam /etc/ssl/dhparam.pem;
ssl_protocols TLSv1.2;
ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256;
ssl_prefer_server_ciphers on;
add_header Strict-Transport-Security "max-age=31536000;";
ssl_stapling on;
ssl_stapling_verify on;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question