Отправка логов NGINX в GrayLog
cat /etc/nginx/graylog.conf
log_format graylog_json escape=json '{ "timestamp": "$time_iso8601", '
'"remote_addr": "$remote_addr", '
'"body_bytes_sent": $body_bytes_sent, '
'"request_time": $request_time, '
'"response_status": $status, '
'"request": "$request", '
'"request_method": "$request_method", '
'"host": "$host",'
'"upstream_cache_status": "$upstream_cache_status",'
'"upstream_addr": "$upstream_addr",'
'"http_x_forwarded_for": "$http_x_forwarded_for",'
'"http_referrer": "$http_referer", '
'"http_user_agent": "$http_user_agent", '
'"http_version": "$server_protocol" }';
access_log syslog:server=logs.newsite.com:5046 graylog_json;
error_log syslog:server=log.newsite.com:5047;
В конфиге nginx в секции http { } указываем:
include /etc/nginx/graylog.conf;
В грейлоге создайте инпуты Syslog UDP и измените logs.newsite.com:5046 и logs.newsite.com:5047 на свой сервер и порт.
Информация
Посетители, находящиеся в группе Гости, не могут оставлять комментарии к данной публикации.
Комментарии
Принудительное обновление сертификата:
certbot certonly --force-renew -d newsite.com
certbot certonly --force-renew -d newsite.com
Получаем SSL сертификат с помощью плагина nginx:
certbot certonly --nginx -d newsite.com -d www.newsite.com
certbot certonly --nginx -d newsite.com -d www.newsite.com
Можно, но я решил описать процесс копирования ключей более подробно.
Или можно просто командой ssh-copy-id [email protected]_host добавить публичный ключ на удалённый сервер.
Какой дистрибутив Linux вы часто используете?
Реклама

Гости1