nginx的多条件and配置 set $match_host '0'; set $match_url '0'; if ($host ~ "192.168.1.105") { set $match_host '1'; } if ($request_uri ~* "test") { set $match_url '${match_host}1'; } if ($match_url = '11'){ return 404; }