ngnix windows版本代理图片或者视频配置

2021-07-09 10:05

阅读:421

server {
listen 80;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;

#####
location ~ .*\.(gif|jpg|jpeg|png|mp4)$ {
expires 24h;
root E:/video/another/;#图片或视频存放路径
access_log E:/video/another/video_nginx.log;#日志文件
proxy_store on;
proxy_store_access user:rw group:rw all:rw;
proxy_temp_path E:/video/another/;#代理临时路径
proxy_redirect off;
proxy_set_header Host 127.0.0.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
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:80;#代理访问地址
} }
####


评论


亲,登录后才可以留言!