Solve the problem of \\"nginx: [emerg] unknown log format \\"main\\"\\"

888u

Last update at :2024-06-21,Edit by888u

Today when Snail was activating website logs for a client project, an error message like \\"nginx: [emerg] unknown log format \\"main\\"\\" appeared when restarting NGINX. Literally, it should be caused by the log format not corresponding. According to the solution found, just add the log format directly to the nginx configuration file.

log_format main \\'$remote_addr – $remote_user [$time_local] \\"$request\\" \\'\\'$status $body_bytes_sent \\"$http_referer\\" \\'\\'\ \"$http_user_agent\\" \\"$http_x_forwarded_for\\"\\';

We start adding the above script to the http script in the nginx.conf file in the current nginx configuration environment. Finally, restart nginx to take effect.

Recommended site searches: free static space, US ASP space, view ip address, registration-free space free network, free proxy ip, domain name information, expired registered domain name, icp registration query, ip reverse query domain name, cloud host,

Solve the problem of \\

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码