Custom base url
Asked by Stephen Bennett:

Hi,

trying to follow the guide:

<https://confluence.atlassian.com/doc/configuring-the-server-base-url-148592.html>

for a kubernetes deployment of confluence on aws. i can create a working confluence using the url of the loadbalancer. but looking to clarify the steps to set up a custom sub domain to host on.

the example on the page uses   

<http://www.foobar.com/confluence>, then your `path` attribute should look like this:

    <context path="/confluence" docBase="../confluence"

in my case i want to use confluence.foobar.com. What should the path and docBase be set to?

I also have 2 Context tags. so not sure which would be updated (both seem to have identical values see below

**Server.xml contents:**

```
<Server port="8000"
shutdown="SHUTDOWN">

<Listener className="org.apache.catalina.startup.VersionLoggerListener"/>
<Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on"/>
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>

<Service name="Catalina">

<Connector port="8090"
maxThreads="100"
minSpareThreads="10"
connectionTimeout="20000"
enableLookups="false"
protocol="HTTP/1.1"
redirectPort="8443"
acceptCount="10"
secure="false"
scheme="http"
proxyName=""
proxyPort=""

relaxedPathChars="[]|"
relaxedQueryChars="[]|{}^\`&quot;&lt;&gt;"
bindOnInit="false"
maxHttpHeaderSize="8192"
useBodyEncodingForURI="true"
disableUploadTimeout="true" />

<Engine name="Standalone"
defaultHost="localhost"
debug="0">
<Host name="localhost"
debug="0"
appBase="webapps"
unpackWARs="true"
autoDeploy="false"
startStopThreads="4">
<Context path=""
docBase="../confluence"
debug="0"
reloadable="false"
useHttpOnly="true">
<!-- Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->
<Manager pathname=""/>
<Valve className="org.apache.catalina.valves.StuckThreadDetectionValve"
threshold="60"/>

</Context>

<Context path="${confluence.context.path}/synchrony-proxy"
docBase="../synchrony-proxy"
debug="0"
reloadable="false"
useHttpOnly="true">
<Valve className="org.apache.catalina.valves.StuckThreadDetectionValve"
threshold="60"/>
</Context>

</Host>
</Engine>

</Service>

</Server>
```


Answers:
author: Evan Underwood-Harley
body: Hi,

Use:

    <context path="" docBase="../confluence"

You don't need to update docBase value.

In the server.xml that is correct as below:

```
<Context path=""
```

Dont update this one as thats to do with the synchrony proxy and it uses the value you set in the first context path in the server.xml:

```
<Context path="${confluence.context.path}/synchrony-proxy"
```

Regards

Evan

comments: author: Stephen Bennett
body: Hi Evan thanks for the post.

So are you saying my file is correct and doesnt need updating then as its already got a

```
<Context path=""
```

Ive deleted the pods which has created new ones. so was expecting it to now work. but I have lost access via the ELB and the subdomain times out (but nslookup does point to the elb correctly.)


author: Evan Underwood-Harley
body: Yes it's correct. Is there any limitation in the kubernetes deployment that it must have a context path?

You can connect to the confluence container, and try running a curl to the localhost:8090 to valid confluence is up and serving with no context path correctly.

Regards

Evan


Tags: domain