taylor swift ai换脸 Nginx(九):搭建静态资源下载管事器
发布日期:2024-11-05 06:28 点击次数:76
最近小编名目凹凸taylor swift ai换脸,由于是APP的 所有这个词对于下载需求相比大,主要起首也曾扫码下载,原先用户少的本领还不错通过管事转发步地进行下载,发现当下载东谈主数加多到一定数目后对于管事器的压力也曾蛮大的,导致管事有本相识蔓延巧合崩溃,为了尽快改善刻下现象,小编决定遴荐Nginx作念为静态资源下载管事器,这么不错在负载后把下载的压力移植到其他带宽较好的管事器上,而不需要占用足下事器的资源。
谎话未几说径直撸代码
user root; worker_processes 4; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; worker_rlimit_nofile 65535; events { use epoll;# worker_connections 65535; } http { include /etc/nginx/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; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; upstream picture { server 123.56.76.187 ; } upstream downloadserver{ server 123.58.76.187; } server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass ; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } server { listen 80; charset utf-8; server_name downloadserver.sht18.com; location / { root /root/app/; if ($request_filename ~* ^.*?\.(txt|doc|pdf|rar|gz|zip|docx|exe|xlsx|ppt|pptx|apk)$){ add_header Content-Disposition: 'attachment;'; } autoindex on; autoindex_exact_size off; autoindex_localtime on; } } }
最主要的便是确立文献的终末一个server管事着实立.监听80端口,因为是线上管事器齐是域名看望步地,是以径直监听80端口就不错,淌若是测试管事器通过ip看望的,不错作念代理转发,也不错径直修改监听端标语,
在location块中确立下文献管事存放地址,以便Nginx鄙人载的本领径直通过文献名从文献目次下查找文献信息
正则匹配的本领是把已这些为隔断的文献径直通过浏览器下载就不错。
熟女论坛咱们看下下载效果,下载咱们居品商互互市家端,令掌柜
好了 以上Nginx 静态资源管事器就搭建完成了taylor swift ai换脸,后续会为全球不时共享对于Nginx静态资源管事器限速下载等执行