我自己修改代码实现了-。-
apache2.2/modules/proxy/mod_proxy_connect.c +123
char *allowed_hosts[] = {
"some host name",
"127.0.0.1",
"localhost"
};
int hosts_num = sizeof(allowed_hosts) / sizeof(allowed_hosts[0]);
int k;
for (k = 0; k < hosts_num; k++) {
if (strncmp(uri.hostname, allowed_hosts[k], strlen(allowed_hosts[k])) == 0) {
break;
}
}
if (k == hosts_num) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY,
apr_pstrcat(p, "host not allowed for: ", uri.hostname, NULL));
}