目的
总结项目中常用的nginx配置,然后通过docker构建一个nginx镜像来快速使用和验证。
目录结构
nginx配置
nginx.conf文件:
user nginx; worker_processes auto; error_log /var/log/nginx/error.log notice; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; keepalive_timeout 75; server_tokens off; autoindex off; charset utf-8; # 开启gzip压缩 gzip on; ......
标签:http,log,配置,nginx,var,镜像 From: https://www.cnblogs.com/simonbaker/p/17700362.html