worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
proxy_ignore_client_abort on;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name moye.test.com;
location / {
if ($host = 'moye.test.com' ) {
proxy_pass http://localhost:8999;
}
}
}
server {
listen 8999;
server_name zhuanfa;
location / {
proxy_pass https://gank.io/api/xiandu/categories;
}
}
}
相信大家一眼就知道这个配置的作用,nginx以这个配置启动后在浏览器连按两下刷新会一直loading,等好长时间才会有数据,怎么解决这个问题,有个现象我觉得可能是导致失败的原因80 和8999 都是nginx自己开放的一瞬间收到两个请求可能nginx内部做了什么操作,在网上搜的proxy_ignore_client_abort on;配置好像并不起作用
如果是
这个样子是怎么请求都是可以的只要不进行二次转发