访问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;
}


}

 

相关文章:

  • 2021-05-12
  • 2021-12-15
  • 2021-11-21
  • 2022-03-07
  • 2022-12-23
猜你喜欢
  • 2022-01-05
  • 2022-01-28
  • 2022-01-07
  • 2021-11-18
  • 2022-01-15
  • 2022-01-22
  • 2021-06-03
相关资源
相似解决方案