1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
| [root@lb01 nginx-1.20.2]
[root@lb01 nginx]
[root@lb01 nginx] [root@lb01 nginx]
[root@lb01 nginx]
[root@lb01 nginx]
[root@lb01 nginx]
user www; worker_processes 10;
error_log /var/log/nginx/error.log notice; pid /var/run/nginx.pid;
events { worker_connections 1024; }
http { include /etc/nginx/mime.types; default_type application/octet-stream;
log_format json '{"@timestamp":"$time_iso8601",' '"host":"$server_addr",' '"service":"nginxTest",' '"trace":"$upstream_http_ctx_transaction_id",' '"log":"log",' '"clientip":"$remote_addr",' '"remote_user":"$remote_user",' '"request":"$request",' '"http_user_agent":"$http_user_agent",' '"size":$body_bytes_sent,' '"responsetime":$request_time,' '"upstreamtime":"$upstream_response_time",' '"upstreamhost":"$upstream_addr",' '"http_host":"$host",' '"url":"$uri",' '"domain":"$host",' '"xff":"$http_x_forwarded_for",' '"referer":"$http_referer",' '"status":"$status"}'; access_log /var/log/nginx/access.log json;
sendfile on;
keepalive_timeout 65;
include /etc/nginx/conf.d/*.conf; }
[root@lb01 nginx] [root@lb01 nginx]
[root@lb01 nginx]
[Unit] Description=nginx - high performance web server Documentation=http://nginx.org/en/docs/ After=network-online.target remote-fs.target nss-lookup.target Wants=network-online.target
[Service] Type=forking PIDFile=/var/run/nginx.pid ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf ExecReload=/bin/sh -c "/bin/kill -s HUP $(/bin/cat /var/run/nginx.pid)" ExecStop=/bin/sh -c "/bin/kill -s TERM $(/bin/cat /var/run/nginx.pid)"
[Install] WantedBy=multi-user.target
[root@lb01 nginx] [root@lb01 sbin] [root@lb01 sbin] [root@lb01 sbin]
[root@lb01 sbin] nginx: [emerg] open() "/usr/local/nginx/conf/nginx.conf" failed (2: No such file or directory) nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
[root@lb01 sbin]
[root@lb01 sbin]
[root@lb01 sbin] nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
|