log_format p_accesslog $remote_addr - $remote_user $time_local $request $status $body_bytes_sent $http_referer $http_user_agent $http_x_forwarded_for; server
This configuration sets up an Nginx server listening on port 8000 and serving files from the /var/www/file directory. It also enables directory listing with autoindex and sets the default charset to utf-8.
The configuration includes rules to deny access to the "repos" directory and to set different expiration times for different file types.
The most important part of this configuration is the last line, which redirects the access log to /dev/stdout. This is useful when running Nginx inside a Docker container, as it allows the container logs to be easily viewed with the docker logs command.
原文地址: https://www.cveoy.top/t/topic/brgL 著作权归作者所有。请勿转载和采集!