Сайт устанавливал с помощью ISPManager.
Вручную сам никакие настройки Apache, Nginx не менял.
Но были проблемы с кешированием. В интернете нашел решение - добавить в conf файл nginx для сайта: add_header Cache-Control "max-age=2592000, public";
Добавил. Помогло. Со спокойной душей лег спать. На утро уже кеширование не работало. Подумал, что мелкий глюк, решил перезагрузить nginx. На что он и выдал:
nginx: [warn] conflicting server name "domain.ru" on SEVER_IP:80, ignored
nginx: [warn] conflicting server name "www.domain.ru" on SEVER_IP:80, ignored
nginx: [warn] conflicting server name "domain.ru" on [2a0***::2]:80, ignored
nginx: [warn] conflicting server name "www.domain.ru" on [2a0***::2]:80, ignored
nginx: [warn] conflicting server name "domain.ru" on SEVER_IP:443, ignored
nginx: [warn] conflicting server name "www.domain.ru" on SEVER_IP:443, ignored
nginx: [warn] conflicting server name "domain.ru" on [2a0***::2]:443, ignored
nginx: [warn] conflicting server name "www.domain.ru" on [2a0***::2]:443, ignored
Настройки nginx (ISPmanager: Домены -> WWW-домены -> Конфиг):
server {
server_name domain.ru www.domain.ru;
charset off;
index index.html index.php;
disable_symlinks if_not_owner from=$root_path;
include /etc/nginx/vhosts-includes/*.conf;
include /etc/nginx/vhosts-resources/domain.ru/*.conf;
access_log /var/www/httpd-logs/domain.ru.access.log;
error_log /var/www/httpd-logs/domain.ru.error.log notice;
set $root_path /var/www/www-root/data/www/domain.ru;
root $root_path;
location / {
location ~ [^/]\.ph(p\d*|tml)$ {
try_files /does_not_exists @fallback;
}
location / {
try_files /does_not_exists @fallback;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
try_files $uri $uri/ @fallback;
expires 30d;
add_header Cache-Control "max-age=2592000, public";
}
}
location @fallback {
proxy_pass http://127.0.0.1:8080;
proxy_redirect http://127.0.0.1:8080 /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
access_log off;
}
return 301 https://$host:443$request_uri;
listen SEVER_IP:80;
listen [2a0***::2]:80;
gzip on;
gzip_comp_level 5;
gzip_disable "msie6";
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
}
server {
server_name domain.ru www.domain.ru;
ssl on;
ssl_certificate "/var/www/httpd-cert/www-root/domain.ru.crtca";
ssl_certificate_key "/var/www/httpd-cert/www-root/domain.ru.key";
ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:RSA+3DES:!NULL:!RC4:!RSA+3DES;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
add_header Strict-Transport-Security "max-age=31536000;";
ssl_dhparam /etc/ssl/certs/dhparam4096.pem;
charset off;
index index.html index.php;
disable_symlinks if_not_owner from=$root_path;
include /etc/nginx/vhosts-includes/*.conf;
include /etc/nginx/vhosts-resources/domain.ru/*.conf;
access_log /var/www/httpd-logs/domain.ru.access.log;
error_log /var/www/httpd-logs/domain.ru.error.log notice;
set $root_path /var/www/www-root/data/www/domain.ru;
root $root_path;
listen SEVER_IP:443;
listen [2a0***::2]:443;
location / {
location ~ [^/]\.ph(p\d*|tml)$ {
try_files /does_not_exists @fallback;
}
location / {
try_files /does_not_exists @fallback;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
try_files $uri $uri/ @fallback;
expires 30d;
add_header Cache-Control "max-age=2592000, public";
}
}
location @fallback {
proxy_pass http://127.0.0.1:8080;
proxy_redirect http://127.0.0.1:8080 /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
access_log off;
}
gzip on;
gzip_comp_level 5;
gzip_disable "msie6";
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
}
<VirtualHost 127.0.0.1:8080>
ServerName domain.ru
DocumentRoot /var/www/www-root/data/www/domain.ru
ServerAdmin admin@domain.ru
AddDefaultCharset off
SuexecUserGroup www-root www-root
CustomLog /var/www/httpd-logs/domain.ru.access.log combined
ErrorLog /var/www/httpd-logs/domain.ru.error.log
<FilesMatch "\.ph(p[3-5]?|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
<IfModule php5_module>
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f admin@domain.ru"
php_admin_value upload_tmp_dir "/var/www/www-root/data/mod-tmp"
php_admin_value session.save_path "/var/www/www-root/data/mod-tmp"
php_admin_value open_basedir "/var/www/www-root/data:."
</IfModule>
<IfModule php7_module>
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f admin@domain.ru"
php_admin_value upload_tmp_dir "/var/www/www-root/data/mod-tmp"
php_admin_value session.save_path "/var/www/www-root/data/mod-tmp"
php_admin_value open_basedir "/var/www/www-root/data:."
</IfModule>
SetEnvIf X-Forwarded-Proto https HTTPS=on
Alias /img "/var/www/www-root/data/img"
Alias /pma "/var/www/www-root/data/pma"
ServerAlias www.domain.ru
DirectoryIndex index.html index.php
</VirtualHost>
<Directory /var/www/www-root/data/www/domain.ru>
Options -ExecCGI
<IfModule php5_module>
php_admin_flag engine on
</IfModule>
<IfModule php7_module>
php_admin_flag engine on
</IfModule>
</Directory>
<Directory /var/www/www-root/data/pma>
php_admin_flag engine on
</Directory>
Гуглить пробовал. Вроде как связано с тем, что настройки дублируются, но дубликатов не нашел. Единственное место, где вроде как лежат эти настройки: /etc/nginx/vhosts/www-root/doman.ru.conf. И немного странно, что изначально заработало.