Где то накосячил, а где именно понять не могу.
В общем перенес сайты на https и пришлось переделывать конфиги.
В логах вижу следующее
2017/01/19 11:52:52 [error] 27878#27878: send() failed (111: Connection refused) while resolving, resolver: ip_сервера:53
2017/01/19 11:52:52 [error] 27878#27878: send() failed (111: Connection refused) while resolving, resolver: ip_сервера:53
2017/01/19 11:52:53 [error] 27880#27880: send() failed (111: Connection refused) while resolving, resolver: ip_сервера:53
2017/01/19 11:52:57 [error] 27880#27880: send() failed (111: Connection refused) while resolving, resolver: ip_сервера:53
2017/01/19 11:53:03 [error] 27880#27880: send() failed (111: Connection refused) while resolving, resolver: ip_сервера:53
2017/01/19 11:53:35 [error] 27879#27879: send() failed (111: Connection refused) while resolving, resolver: ip_сервера:53
2017/01/19 11:53:49 [error] 27881#27881: send() failed (111: Connection refused) while resolving, resolver: ip_сервера:53
2017/01/19 11:53:54 [error] 27878#27878: send() failed (111: Connection refused) while resolving, resolver: ip_сервера:53
Конфиги:
Редиректы /etc/nginx/sites-available/redirects
server {
listen 80;
listen [::]:80;
server_name static.domain.ru;
expires max;
return 301 https://static.domain.ru$request_uri;
}
server {
server_name domain.ru;
listen domain.ru:443 ssl;
ssl_certificate /etc/letsencrypt/live/domain.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.ru/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/domain.ru/chain.pem;
ssl_stapling on;
ssl_stapling_verify on;
resolver ip server 8.8.8.8;
add_header Strict-Transport-Security "max-age=31536000";
expires max;
return 301 https://www.domain.ru$request_uri;
}
Конфиг для доменов со статикой
server {
server_name img.domain.ru;
listen img.domain.ru:443 ssl;
ssl_certificate /etc/letsencrypt/live/domain.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.ru/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/domain.ru/chain.pem;
ssl_stapling on;
ssl_stapling_verify on;
resolver ip 8.8.8.8;
add_header Strict-Transport-Security "max-age=31536000";
add_header Content-Security-Policy "block-all-mixed-content";
error_log /var/log/nginx/img.domain.ru.log crit;
access_log off;
# pass the request to the node.js server with the correct headers
# and much more can be added, see nginx config options
include acme;
location / {
root /var/www/img.domain.ru;
expires 30d;
}
}
Конфиг для сайта
upstream www.domain.ru {
server 127.0.0.1:9000;
keepalive 8;
}
# the nginx server instance
server {
server_name www.domain.ru;
listen www.domain.ru:443 ssl;
ssl_certificate /etc/letsencrypt/live/domain.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.ru/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/domain.ru/chain.pem;
ssl_stapling on;
ssl_stapling_verify on;
resolver ip 8.8.8.8;
add_header Strict-Transport-Security "max-age=31536000";
add_header Content-Security-Policy "block-all-mixed-content";
error_log /var/log/nginx/domain.ru.log crit;
access_log off;
# pass the request to the node.js server with the correct headers
# and much more can be added, see nginx config options
location / {
root /var/www/domain.ru;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://www.domain.ru/;
proxy_redirect off;
}
}
И основной конфиг nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
#access_log /var/log/nginx/access.log;
access_log off;
error_log /var/log/nginx/error.log crit;
##
# My Setting
##
client_max_body_size 35M;
client_body_buffer_size 4M;
client_header_buffer_size 1M;
large_client_header_buffers 8 640K;
proxy_buffers 8 16k;
proxy_buffer_size 16k;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
server_tokens off;
open_file_cache max=200000 inactive=20s;
open_file_cache_valid 60s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
charset UTF-8;
reset_timedout_connection on;
send_timeout 2;
#client_max_body_size 16M;
server_names_hash_bucket_size 128;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
gzip_min_length 10240;
gzip_proxied expired no-cache no-store private auth;
gzip_comp_level 5;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}