openssl x509 -in /etc/letsencrypt/live/nene.ru/fullchain.pem -noout -text -purpose
X509v3 Subject Alternative Name:
DNS:nene.ru, DNS:www.nene.ru
server_name www.nene.ru;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_certificate /etc/letsencrypt/live/nene.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/nene.ru/privkey.pem;
И что плохого в том, что я буду на хосте (а не в контейнере) запускать сайты от отдельного пользователя)?
Насколько я понимаю, т.к. tls соединение ниже по уровню, чем http я не смогу отправить http редирект юзеру на неустановленном соединении...
curl -D - -o /dev/null -s new.site.com
server{
listen 80;
server_name jira.lc;
rewrite ^(/.*)$ https://jira.lc permanent;
}
server {
listen 80;
server_name jira.lc;
return 301 https://jira.lc$request_uri;
}
Весту совсем не обязательно держать постоянно включенной на сервере, можно запускать при необходимости изменения конфигурации, а потом останавливать обратно.
И это, пожалуй, лучшая панелька.
failregex = limiting request, excess:.* by zone.*client:
2017/11/13 16:49:26 [error] 32586#32586: *7180527 limiting requests, excess: 40.070 by zone "req_limit_per_ip", client: 81.90.213.XXX, server: xxxx.org, request: "GET /netcat_files/944/2882/h_5d52b860ac4b98eaeb00e9d1d434cd8a HTTP/1.1", host: "xxxx.org", referrer: "xxxx.org/account"
# fail2ban-regex /var/www/xxxx.org/log/error.log /etc/fail2ban/filter.d/nginx-req-limit.conf
Running tests
=============
Use failregex file : /etc/fail2ban/filter.d/nginx-req-limit.conf
Use log file : /var/www/xxxx.org/log/error.log
Results
=======
Failregex: 0 total
Ignoreregex: 0 total
Date template hits:
|- [# of hits] date format
| [53] Year/Month/Day Hour:Minute:Second
`-
Lines: 53 lines, 0 ignored, 0 matched, 53 missed
Missed line(s): too many to print. Use --print-all-missed to print all 53 lines
failregex = ^\s*\[error\] \d+#\d+: \*\d+ limiting requests, excess: [\d\.]+ by zone "[^"]+", client: <HOST>
-----BEGIN CERTIFICATE-----
MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDAN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ckh49ZLOMxt+/yUFw
7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD
aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV
HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG
SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69
ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr
AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz
R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5
JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo
Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ
-----END CERTIFICATE-----
# nginx -V
nginx version: nginx/1.13.6
built by gcc 4.9.2 (Debian 4.9.2-10)
built with OpenSSL 1.0.2m 2 Nov 2017
TLS SNI support enabled
server {
listen 443 ssl;
server_name universal-chat.net www.universal-chat.net;
...
}
server {
listen 443 http2 ssl;
server_name www.universal-chat.net;
ssl_protocols TLSv1.1 TLSv1.2;
ssl_certificate "/etc/letsencrypt/live/api.universal-chat.net/cert.pem";
ssl_certificate_key "/etc/letsencrypt/live/api.universal-chat.net/privkey.pem";
return 301 https://universal-chat.net$request_uri;
}
server {
listen 443 http2 ssl;
server_name universal-chat.net;
ssl_protocols TLSv1.1 TLSv1.2;
ssl_certificate "/etc/letsencrypt/live/api.universal-chat.net/cert.pem";
ssl_certificate_key "/etc/letsencrypt/live/api.universal-chat.net/privkey.pem";
...
}
...
ssl_session_cache shared:UNISSL:10m;
ssl_session_timeout 10m;
ssl_prefer_server_ciphers on;
ssl_session_tickets off;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /etc/nginx/ssl/letsencrypt-ca.pem;
ssl_stapling_responder http://ocsp.int-x3.letsencrypt.org;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
...