记录使用wsl环境nginx代理超时的处理方法
有问题的配置
set $webpack_server http://127.0.0.1:3030;
location ~ ^/static-dist {
proxy_pass $webpack_server;
}
解决后的配置
set $webpack_server http://127.0.0.1:3030;
location ~ ^/static-dist {
proxy_connect_timeout 1;
proxy_send_timeout 300;
proxy_read_timeout 300;
proxy_buffer_size 2M;
proxy_buffers 16 2M;
proxy_busy_buffers_size 2M;
proxy_temp_file_write_size 2M;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass $webpack_server;
}
有耕耘、有搬运、共学习