Инсталиране,конфигуриране и пренасочване на ssl сертификат от суперхостинг

1. Генериране на nginx файлове от Суперхостинг

cat „Частен ключ (Private Key)“ > nginx.key

cat „Сертификат“ > bundle.crt
cat „CA-Bundle / Root certificate“ >> bundle.crt

На практика bundle.crt, включва „Сертификат“ и „CA-Bundle / Root certificate“
2. .htaccess
RewriteEngine On

RewriteBase /
RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
RewriteRule ^(.*)$ https://domain.com/$1 [L,R=301]

3. Nginx

server
{
listen 80;
listen 443 ssl;
server_name domain.com www.domain.com;
ssl_certificate /etc/nginx/ssl/domain.com/bundle.crt;
ssl_certificate_key /etc/nginx/ssl/domain.comg/nginx.key;
if ($server_port = 80) {
rewrite ^/(.*)$ https://profi.bg/$1 permanent;
}

………..
}

4. Reload
nginx -t
/etc/init.d/nginx reload

Категория:

Logged in as {{omniform_current_user_display_name}}. Edit your profile. Log out? Required fields are marked *

Your email address will not be published. Required fields are marked *

Comments are closed.

You must be logged in to post a comment.