Skip to content

Commit

Permalink
fix nginx日志写入/opt/nginx.log
Browse files Browse the repository at this point in the history
  • Loading branch information
thsrite committed May 26, 2024
1 parent e2bfe08 commit 4bcdb4e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ if ! grep -q "access_log /dev/stdout main;" /etc/nginx/nginx.conf; then
fi

# nginx日志写入/opt/nginx.log
if ! grep -q "error_log /opt/nginx.log info;" /etc/nginx/nginx.conf; then
sed -i 's#error_log /var/log/nginx/error.log notice;#error_log /opt/nginx.log info;#' /etc/nginx/nginx.conf
if ! grep -q "error_log /opt/nginx.log info;" /etc/nginx/nginx.conf; then
sed -i 's#error_log /var/log/nginx/error.log notice;#error_log /opt/nginx.log info;#' /etc/nginx/nginx.conf
fi
if ! grep -q "access_log /opt/nginx.log main;" /etc/nginx/nginx.conf; then
sed -i 's#access_log /var/log/nginx/access.log main;#access_log /opt/nginx.log main;#' /etc/nginx/nginx.conf
if ! grep -q "access_log /opt/nginx.log main;" /etc/nginx/nginx.conf; then
sed -i 's#access_log /var/log/nginx/access.log main;#access_log /opt/nginx.log main;#' /etc/nginx/nginx.conf
fi

# 替换http、https端口
Expand Down

0 comments on commit 4bcdb4e

Please sign in to comment.