About Atlassian doc Using Apache with mod_proxy

Ma Hao March 21, 2016

This question is in reference to Atlassian Documentation: Using Apache with mod_proxy

When i am try the Complex configuration, i was confused about "ProxyHTMLURLMap / /confluence/".

After proxyPass set as "ProxyPass / http://app-server.internal.example.com:8090/confluence".

I suppose all links should be modified from "/confluence" to "/".

 

Am i right?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 22, 2016

If your Confluence is running on http://app-server:8090/confluence/ , then the proxy string should be /confluence/

If you want to run it on just /, then you need to alter the server.xml to make it run on http://app-server:8090/ as well as the Apache proxy.

There's also a minor quirk in the way mod_proxy works, I'm not going to pretend I understand it, but I've always been told to end both the proxy and source with either a blank or a / - don't have one with it and one without.

Ma Hao March 22, 2016

Thanks for your answer.

I know your answer is about proxyPass configuration.

But my question is about "ProxyHTMLURLMap" from mod_proxy_html of apache.

Description:

mod_proxy_html is an output filter to rewrite HTML links in a proxy situation, to ensure that links work for users outside the proxy. It serves the same purpose as Apache's ProxyPassReverse directive does for HTTP headers, and is an essential component of a reverse proxy.

For example, if a company has an application server at appserver.example.com that is only visible from within the company's internal network, and a public webserver www.example.com, they may wish to provide a gateway to the application server athttp://www.example.com/appserver/. When the application server links to itself, those links need to be rewritten to work through the gateway. mod_proxy_html serves to rewrite <a href="http://appserver.example.com/foo/bar.html">foobar</a> to <a href="http://www.example.com/appserver/foo/bar.html">foobar</a> making it accessible from outside.

On the Atlassian doc of "Complex configuration", it was configured as "ProxyHTMLURLMap / /confluence/".

From my understanding, it will rewrite HTML links from "/" to "/confluence/", which will cause all links end with "/" to access "http://myconfluence.com/confluence" and proxyPass will forward the request to "http://app-server.internal.example.com:8090/confluence/confluence".

Which means this configuration is totally wrong.

Correct one should be "ProxyHTMLURLMap  /confluence/  /", which will rewrite HTML links from  "/confluence/" to "/" , which will lead the request(url is "/confluence/") to "http://myconfluence.com/"(my expected url). 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 22, 2016

Ah, ok, I missed that, but you still need to get the other two points correct for this to work.

TAGS
AUG Leaders

Atlassian Community Events