mirror of
https://github.com/ONLYOFFICE/Docker-Docs.git
synced 2025-04-18 15:04:02 +03:00
Add the ability to set up nginx log format
Co-authored-by: VyacheslavSemin <vyacheslav.semin@onlyoffice.com> Co-committed-by: VyacheslavSemin <vyacheslav.semin@onlyoffice.com>
This commit is contained in:
parent
a70d1a4fbf
commit
2d5e9c1cda
@ -10,9 +10,7 @@ events {
|
||||
}
|
||||
|
||||
http {
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log off;
|
||||
|
||||
|
@ -7,6 +7,9 @@ fi
|
||||
cp -r /etc/nginx/* /tmp/proxy_nginx/
|
||||
sed 's|\(worker_connections\) [[:digit:]]*;|\1 '$NGINX_WORKER_CONNECTIONS';|g' -i /tmp/proxy_nginx/nginx.conf
|
||||
sed "s/\(worker_processes\).*/\1 $NGINX_WORKER_PROCESSES;/" -i /tmp/proxy_nginx/nginx.conf
|
||||
if [[ -n "$NGINX_LOG_FORMAT" ]]; then
|
||||
sed "s/\(log_format main\).*/\1 '$NGINX_LOG_FORMAT';/" -i /tmp/proxy_nginx/nginx.conf
|
||||
fi
|
||||
if [ $NGINX_ACCESS_LOG != "off" ]; then
|
||||
sed 's|#*\(\s*access_log\).*;|\1 /var/log/nginx/access.log '$NGINX_ACCESS_LOG';|g' -i /tmp/proxy_nginx/nginx.conf
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user