Полный конфиг моего сервера
файл s1.conf
# Default website
server {
listen 80 default_server;
server_name www.mydomain.ru mydomain.ru;
return 301 https://mydomain.ru$request_uri ;
server_name_in_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host:80;
set $proxyserver "http://127.0.0.1:8888";
set $docroot "/home/bitrix/www";
index index.php;
root /home/bitrix/www;
# Redirect to ssl if need
#if (-f /home/bitrix/www/.htsecure) { rewrite ^(.*)$ https://$host$1 permanent; }
# Include parameters common to all websites
include bx/conf/bitrix.conf;
# Include server monitoring locations
include bx/server_monitor.conf;
}
файл ssl.s1.conf
server{
listen 443;
server_name www.mydomain.ru;
return 301 $scheme://mydomain.ru$request_uri;
}
server {
listen 443 default_server ssl;
server_name mydomain.ru;
# Enable SSL connection
include bx/conf/ssl.conf;
server_name_in_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host:443;
proxy_set_header HTTPS YES;
set $proxyserver "http://127.0.0.1:8888";
set $docroot "/home/bitrix/www";
index index.php;
root /home/bitrix/www;
# Include parameters common to all websites
include bx/conf/bitrix.conf;
# Include server monitoring API's
include bx/server_monitor.conf;
}
файл ssl.conf
# If they come here using HTTP, bounce them to the correct scheme
# Nginx internal code used for the plain HTTP requests
# that are sent to HTTPS port to distinguish it from 4XX in a log and an error page redirection.
error_page 497 https://$host$request_uri;
# Increase keepalive connection lifetime
keepalive_timeout 70;
keepalive_requests 150;
# SSL encryption parameters
ssl on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:D$
ssl_prefer_server_ciphers on;
ssl_certificate /etc/nginx/ssl/mydomain.ru.pem;
ssl_certificate_key /etc/nginx/ssl/private.key;
# performance
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
bx/conf/bitrix.conf и bx/server_monitor.conf не трогал - они дефолтные
Решение стоит на bitrixVM (на базе CentOS)