🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] ## 配置静态图片服务器 配置文件 ``` worker_processes 1; error_log logs/error.log; events { worker_connections 1024; } http { server { listen 8888; default_type application/octet-stream; sendfile on; keepalive_timeout 65; location / { root /aseit-data/work_zhang/AI_ceshi/hudong_ai/; #html访问路径 index index.html index2.htm; #html文件名称 autoindex on; #打开目录浏览功能 } location ~.*\.(jpg|jepg|gif|css|png|ico|html)?$ { expires 24h; root /aseit-data/work_zhang/AI_ceshi/hudong_ai/;#指定图片存放路径 access_log logs/images.log;#日志存放路径 proxy_store on; proxy_store_access user:rw group:rw all:rw; proxy_temp_path /var/www/html;#图片访问路径 proxy_redirect off; proxy_set_header Host 127.0.0.1; client_max_body_size 10m; client_body_buffer_size 1280k; proxy_connect_timeout 900; proxy_send_timeout 900; proxy_read_timeout 900; proxy_buffer_size 40k; proxy_buffers 40 320k; proxy_busy_buffers_size 640k; proxy_temp_file_write_size 640k; if ( !-e $request_filename) { proxy_pass http://127.0.0.1:8888;#默认80端口 } } } } ```