bug fix
This commit is contained in:
parent
b1a484f4d0
commit
c54bc33b6b
1 changed files with 6 additions and 5 deletions
|
@ -1,9 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Define the log format
|
# Define the log format (all on one line)
|
||||||
LOG_FORMAT='log_format domain_combined '\''$host $remote_addr - $remote_user [$time_local] '\
|
LOG_FORMAT='log_format domain_combined '\''$host $remote_addr - $remote_user [$time_local] "\"$request\"" $status $body_bytes_sent "\"$http_referer\"" "\"$http_user_agent\""'\'';'
|
||||||
''\"$request\" $status $body_bytes_sent '\
|
|
||||||
''\"$http_referer\" \"$http_user_agent\"'\'';'
|
|
||||||
|
|
||||||
# Check if we're root
|
# Check if we're root
|
||||||
if [ "$EUID" -ne 0 ]; then
|
if [ "$EUID" -ne 0 ]; then
|
||||||
|
@ -12,7 +10,10 @@ if [ "$EUID" -ne 0 ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Backup the original config
|
# Backup the original config
|
||||||
cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
|
if ! cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak; then
|
||||||
|
echo "Failed to create backup"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Check if format already exists
|
# Check if format already exists
|
||||||
if grep -q "log_format domain_combined" /etc/nginx/nginx.conf; then
|
if grep -q "log_format domain_combined" /etc/nginx/nginx.conf; then
|
||||||
|
|
Loading…
Reference in a new issue