想让apache反向代理实现二级域名
apache+iis
<VirtualHost *:80>
ProxyRequests On
ServerName *.yishangwang.net.cn
proxypass / http://192.168.1.21:88/
proxypassreverse /http://192.168.1.21:88/
</VirtualHost>
可找开的确是apache测试页面。 然后我在后面再加上端口就进去了。ywj.yishangwang.net.cn(打开的是apache测试页,ywj.yishangwang.net.cn:88/这样就能进入了。)不知道为什么。在http://192.168.1.21:88/下面有个dns文件
在这里取不取Http_host这个地址? 请教该如何解决
dns.asp
<!--#include file= "conn/conn.jsp "-->
<!--#include file= "inc/safe.jsp "-->
<%
sURL=replace(Request.ServerVariables( "HTTP_HOST "), "www. ", " ")
if InStr(sURL, "= ") <> 0 or InStr(sURL, "` ") <> 0 or InStr(sURL, " ' ") <> 0 or InStr(sURL, " ") <> 0 or InStr(sURL, " ") <> 0 or InStr(sURL, " ' ") <> 0 or InStr(sURL,chr(34)) <> 0 or InStr(sURL, "\ ") <> 0 or InStr(sURL, ", ") <> 0 or InStr(sURL, " < ") <> 0 or InStr(sURL, "> ") <> 0 then
Response.Status= "404 no found "
Response.End
end if
first_name=split(sURL, ". ")
if ubound(first_name)> 3 then
Response.Status= "404 no found "
Response.End
end if
if first_name(0)= "test " then
response.write getUrl( " "&WebUrl& "test/index.asp ")
elseif first_name(0)= "guanjian " then
response.write getUrl( " "&WebUrl& "guanjian/index.asp ")
else
if first_name(1)= "yishangwang " then
sql= "select url,[user] from corporation where [user]= ' "&first_name(0)& " ' and (mbflag=1 or flag=1) "
Set rs= Server.CreateObject( "ADODB.Recordset ")
rs.open sql,conn,1,1
if rs.eof then
response.write getUrl( " "&WebUrl& "company/no.jsp ")
else
response.write getUrl( " "&WebUrl& " "&replace(rs( "url "), " "&rs( "user ")& ".html ", "home.jsp?MemberId= "&rs( "user ")& " ")& " ")
end if
rs.Close
set rs=nothing
conn.Close
set conn=nothing
else
response.write " <div align=center> <br> <br> <br> <font color=red> 此用户已经被删除或未通过审核! </font> </div> "
response.write " <div align=center> <br> <br> <br> <b> <a href=javascript:history.go(-1)> 返回 </a> </b> </div> "
end if
end if
%>