server {
//тут логи ссл и прочее
# Прочие настройки
client_max_body_size 100m;
client_body_buffer_size 128k;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
client_header_buffer_size 1k;
large_client_header_buffers 4 16k;
fastcgi_connect_timeout 864000;
fastcgi_read_timeout 864000;
fastcgi_send_timeout 864000;
proxy_read_timeout 864000;
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf|webp|bmp|woff|csv)$ {
expires 365d;
}
location / {
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf|webp|bmp|woff|csv)$ {
expires 365d;
}
rewrite ^/api/(.*)$ /api.php?_d=$1&ajax_custom=1&$args last;
try_files $uri $uri/ @fallback;
location ~ [^/]\.ph(p\d*|tml)$ {
try_files /does_not_exists @php;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf|webp|bmp|woff|csv)$ {
expires 365d;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
expires 24h;
}
}
# Правиле rewrite для модуля SEO
location @fallback {
rewrite ^(.*)$ /index.php?$args last;
}
location @php {
fastcgi_index index.php;
fastcgi_keep_conn on;
fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@domen.ru";
fastcgi_pass unix:/var/www/php-fpm/1.sock;
fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
try_files $uri =404;
include fastcgi_params;
}
listen 1.1.1.1:443 ssl;
}
$this->conn = mysqli_init();
$this->conn->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, true);
$this->conn->ssl_set(NULL, NULL, '/var/www/www-root/data/www/domen.ru/root.crt', NULL, NULL);
$this->conn->real_connect($host, $user, $passwd, $database, $port, NULL, NULL);
$conn->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, false);