openssl genrsa -out private.key 2048
openssl req -new -sha256 -key private.key -out csr.csr
, and the information (such as company name, email) is taken through the whois service (why ask the boss again all when you can find out everything yourself). cat csr.csr
copied the code and pasted it where necessary. mv private.key /etc/nginx/private.key
ssl_session_cache shared:SSL:10m; ssl_session_timeout 5m; ssl_prefer_server_ciphers on; ssl_stapling on; resolver 8.8.8.8;
server { listen 443 ssl; server_name www.site.ru; root /var/www/html/web/; # root, - index index.php index.html; set $yii_bootstrap "index.php"; # yii, location / { # Define the index index index.html $yii_bootstrap; try_files $uri $uri/ /$yii_bootstrap?$args; } # Any of the protected directories, we will ignore. There is no reason # to share out the protected web spaces location ~ ^/(commands|components|config|controllers|models|vendor|views) { deny all; } #avoid processing of calls to unexisting static files by yii location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { try_files $uri =404; } ....... keepalive_timeout 60; ssl_certificate certificate_bundled.crt; ssl_certificate_key private.key; ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers "RC4:HIGH:!aNULL:!MD5:!kEDH"; add_header Strict-Transport-Security 'max-age=604800'; ....... location ~ \.php$ { ....... fastcgi_param HTTPS on; # php-fpm ....... } }
openssl rsa -in /etc/nginx/private.key -out /etc/nginx/private.key
nginx -s reload
and - voila!Source: https://habr.com/ru/post/250931/
All Articles