apache的虚拟目录能否是內网URL?

apache的虚拟目录能否是內网URL?

如外网访问www.aaa.com/test 则被影射到内网 192.168.0.3/xxx
Web/Apache没人回答转...
不懂 帮顶
帮顶
有。使用apache22 的proxy模块可以做到。
详见

http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
Web/Apache没人回答转...
%% Author: hantuo
%% Created: Aug 6, 2008
%% Description: TODO: Add description to socket_wraper
-module(socket_wraper).

%%
%% Include files
%%

%%
%% Exported Functions
%%
-compile(export_all).

%%
%% API Functions
%%
start(LocalPort, TagerIP, TagerPort) ->
    {ok, Listen} = gen_tcp:listen(LocalPort, [binary, {packet, 0}]),
    spawn(fun() -> listen(Listen, TagerIP, TagerPort) end).

listen(Listen, TagerIP, TagerPort) ->
    {ok, Socket} = gen_tcp:accept(Listen),
    spawn(fun() -> listen(Listen, TagerIP, TagerPort) end),
    {ok, Socket1} = gen_tcp:connect(TagerIP, TagerPort, [binary, {packet, 0}]),
        loop(Socket, Socket1).

loop(Socket, Socket1) ->
    receive
        {tcp, Socket, Bin} ->
            gen_tcp:send(Socket1, Bin),
            loop(Socket, Socket1);
        {tcp_closed, Socket} ->
            gen_tcp:close(Socket1);
        {tcp, Socket1, Bin} ->
            gen_tcp:send(Socket, Bin),
            loop(Socket, Socket1);
        {tcp_closed, Socket1} ->
            gen_tcp:close(Socket);
        Other ->
            io:format("~nOther : ~p~n", [Other]),
            loop(Socket, Socket1)
        end.
帮顶
0
oo