访问192.168.112.10:8893,通过url地址的正则匹配 访问不通的代理地址 server { listen 8893; server_name 192.168.112.10; location ~/(2020/0[1-5]/([0-3][0-9])|(201[8-9])/([0-1][0-9])/([0-3][0-9]))/ { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://192.168.50.15:8891; } location ~/(2020/06/(0[1-9]|10))/ { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://192.168.50.15:8891; } location ~/(2020/(0[6-9]|10|11|12)/([0-3][0-9]))/ { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://192.168.12.10:8892; } }