Confused about remote Web access?

View: New views
1 Messages — Rating Filter:   Alert me  

Confused about remote Web access?

by dmark :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Seems like a lot of people are.  Here's another clue.  This file is included in the header of every MHX page.

head.pl

Specifically, this logic was added for secure proxies:

if ($Socket_Ports{http}{client_ip_address} eq '127.0.0.1' or $Socket_Ports{http}{client_ip_address} eq 'localhost') {
        $html .= qq|<base href="http://$Socket_Ports{http}{client_ip_address}:8080/mhx/">|
}
elsif (&is_local_address()) {
        if (!$config_parms{http_server} or $config_parms{http_server} eq 'localhost') {
                my $local_host = &get_ip_address();
                $html .= qq|<base href="http://$local_host:$config_parms{http_port}/mhx/">|
        }
        else {
                $html .= qq|<base href="http://$config_parms{http_server}:$config_parms{http_port}/mhx/">|
        }
}
else {
        if ($config_parms{http_server_path_external}) {
                $html .= qq|<base href="http://$config_parms{http_server_external}:$config_parms{http_port_external}/mhx/">| if $config_parms{http_server_external} and $config_parms{http_server_port_external};
        }
        else {
                $html .= qq|<base href="http://$config_parms{http_server_external}:$config_parms{http_port_external}/$config_parms{http_server_path_external}/mhx/">| if $config_parms{http_server_external} and $config_parms{http_server_port_external};
        }
}

Configuration parameters:

# Intranet references (auto-detected)
http_server =
# Extranet references (often will be a reverse proxy, otherwise the external IP address of your router)
http_server_external =
http_server_port_external =


# The path to your site on the proxy server
http_server_external_path =
#http_server_external_path = mysite

NOTE: They are all empty.  This is because I do not use remote access and the local IP is populated automatically (as it should be.)  Also interesting to note that the default in SVN is "localhost" and this same parameter is used for base href's in email messages (which makes no sense.)  Any module that references the http_server parameters needs to use logic similar to the above.

This is the proper solution.  The one in the Wiki that rewrites links on-the-fly is high comedy.