公司图片Windows服务机器准备迁移到Linux,约有公司 2.8KW 张零碎图片 1.8T 文件占有量。
复制代码代码示例:
events {
(责任编辑:IT)worker_connections 65535; use epoll; } 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 logs/access.log main; access_log off; charset utf-8; keepalive_timeout 60; sendfile off; tcp_nopush off; client_header_buffer_size 8k; large_client_header_buffers 8 128k; client_max_body_size 300m; client_body_buffer_size 2048k; gzip off; server { server_name _; # rewrite (.*)$ /opt/nginx/html/404.html?; return 404; error_page 404 = /opt/nginx/html/404.html; } include nginx-upload.conf; server { listen 80; server_name file.xxx.com; root /usr/local/wwwweb/file.xxx.com; #access_log /opt/nginx/logs/file.xxx.com; access_log off; location ~ .*\.(gif|jpg|jpeg|png)$ { root /usr/local/wwwweb/file.xxxx.com; #if ( !-f request_name ) { if ( $status = 404 ) { rewrite /(.*)\.jpg /$1.JPG; rewrite /(.*)\.JPG /$1.jpg; } } } } |