Problems with setting based URL.
Asked by Aleksei Grishchenko:

Good day. Got some issues with configuring centos server with nginx + php-fpm. Cant change base URL on server, every time it comes back to using IP as access adress of server.

Add a screenshots of configure files of tomcat and nginx.![Screenshot_7.jpg](/t5/image/serverpage/image-id/20590i2E76EBE658B1FFEF/image-size/large?v=v2&px=999 "Screenshot_7.jpg")![Screenshot_8.jpg](/t5/image/serverpage/image-id/20589i7EE0BEA019AD1E47/image-size/large?v=v2&px=999 "Screenshot_8.jpg")


Answers:
author: AnnWorley
body: Hi Aleksei,

I understand you are having trouble [configuring the base URL](https://confluence.atlassian.com/doc/configuring-the-server-base-url-148592.html) to use a proxied URL instead of an IP address and port. Since you are using a Synchrony location in your NGINX configuration, I am assuming you are using a version of Confluence later than 6.0.

I noticed your server.xml is different from the documentation ([How to use NGINX to proxy requests for Confluence](https://confluence.atlassian.com/confkb/how-to-use-nginx-to-proxy-requests-for-confluence-313459790.html)) in the way the context path is defined. Here is an example of default server.xml "out of the box":

```
<Server port="8000" shutdown="SHUTDOWN" debug="0">
 <Service name="Tomcat-Standalone">
 <Connector port="8090" connectionTimeout="20000" redirectPort="8443"
 maxThreads="48" minSpareThreads="10"
 enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"
 protocol="org.apache.coyote.http11.Http11NioProtocol" />

<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">
 <!-- Logger is deprecated in Tomcat 5.5. 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>

<!--
 To run Confluence via HTTPS:
 * Uncomment the Connector below
 * Execute:
 %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
 $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
 with a password value of "changeit" for both the certificate and the keystore itself.
 * Restart and visit https://localhost:8443/

For more info, see https://confluence.atlassian.com/display/DOC/Running+Confluence+Over+SSL+or+HTTPS
 -->
<!--
 <Connector port="8443" maxHttpHeaderSize="8192"
 maxThreads="150" minSpareThreads="25"
 protocol="org.apache.coyote.http11.Http11NioProtocol"
 enableLookups="false" disableUploadTimeout="true"
 acceptCount="100" scheme="https" secure="true"
 clientAuth="false" sslProtocols="TLSv1,TLSv1.1,TLSv1.2" sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2" SSLEnabled="true"
 URIEncoding="UTF-8" keystorePass="<MY_CERTIFICATE_PASSWORD>"/>
-->
 </Service>
</Server>
```

Please try these steps:

* Back-up your server.xml
* Create a new server.xml from the default above, so changing only:

1. Add your MySQL [datasource](https://confluence.atlassian.com/doc/configuring-a-datasource-connection-937166084.html), just as in your posted file, that's the block that starts with \<Resource and ends with \>
2. Change the connector port to 8080 in the first connector where the above has 8090
3. Add your proxyName, proxyPort and scheme to the 8080 connector just as you have in the file you posted
4. Add the context path "/confluence" to the existing context statement, just under \<Host name="IP_address" rather than adding it later on it's own line

I look forward to hearing whether you can successfully configure the Base URL after reviewing the linked [documentation](https://confluence.atlassian.com/confkb/how-to-use-nginx-to-proxy-requests-for-confluence-313459790.html) and trying the default context path setting.

Thanks,

Ann

comments: author: Aleksei Grishchenko
body: Redirecting is working now. But got another problem, infinity upload of page creating. [https://confluence.atlassian.com/confkb/after-upgrading-confluence-you-are-unable-to-create-new-pages-or-spaces-785457379.html?utm_medium=logScan\&utm_source=STP](https://confluence.atlassian.com/confkb/after-upgrading-confluence-you-are-unable-to-create-new-pages-or-spaces-785457379.html?utm_medium=logScan&utm_source=STP) , already did all what said in resolution, it didnt help.


author: Aleksei Grishchenko
body: 2018-04-26 15:07:21,736 INFO \[172.31.0.75-startStop-1\] \[com.atlassian.confluence.lifecycle\] init Confluence is ready to serve  
2018-04-26 15:07:41,533 WARN \[http-nio-8080-exec-3\] \[webresource\] findItChangesArguments cyclic plugin resource dependency has been detected with: com.atlassian.conflue  
-- referer: <http://wiki.alfaic.ua/pages/createpage.action?spaceKey=IT> \| url: /rest/webResources/1.0/resources \| traceId: 33403fd1dcb0262e \| userName: aicwikiadmin  
2018-04-26 15:07:41,550 WARN \[http-nio-8080-exec-3\] \[webresource\] findItChangesArguments cyclic plugin resource dependency has been detected with: com.atlassian.conflue  
-- referer: <http://wiki.alfaic.ua/pages/createpage.action?spaceKey=IT> \| url: /rest/webResources/1.0/resources \| traceId: 33403fd1dcb0262e \| userName: aicwikiadmin  
2018-04-26 15:08:41,019 WARN \[http-nio-8080-exec-1\] \[webresource\] findItChangesArguments cyclic plugin resource dependency has been detected with: com.atlassian.conflue  
-- referer: <http://wiki.alfaic.ua/pages/createpage.action?spaceKey=IT> \| url: /rest/webResources/1.0/resources \| traceId: 057375800ee2fbc6 \| userName: aicwikiadmin  
2018-04-26 15:08:41,025 WARN \[http-nio-8080-exec-1\] \[webresource\] findItChangesArguments cyclic plugin resource dependency has been detected with: com.atlassian.conflue  
-- referer: <http://wiki.alfaic.ua/pages/createpage.action?spaceKey=IT> \| url: /rest/webResources/1.0/resources \| traceId: 057375800ee2fbc6 \| userName: aicwikiadmin

text in logfile


author: AnnWorley
body: Interesting - since the error is plugin related, please try clearing the plugin cache as described in [How to clear Confluence plugins cache](https://confluence.atlassian.com/confkb/how-to-clear-confluence-plugins-cache-297664846.html).

Do the errors really not list the entire plugin name? The errors in this [bug report](https://jira.atlassian.com/browse/CONFCLOUD-53981) do list them so it's more convenient to troubleshoot:
> 2015-07-16 17:26:18,856 WARN \[http-nio-8099-exec-5\] \[webresource\] resolveBundleDependencies cyclic plugin resource dependency has been detected with: confluence.web.resources:ajs, stack trace: \[_context:onboarding, com.atlassian.confluence.plugins.confluence-onboarding:onboarding-flow-resources, com.atlassian.confluence.plugins.confluence-user-profile:avatar-picker, confluence.web.resources:ajs, confluence.web.resources:meta, confluence.web.resources:jquery\]


author: Aleksei Grishchenko
body: Unfortunately, it doesnt help, still infinity window of page creating. Can it be cause of my nginx cfg file have no next strings

    location /synchrony {        proxy_set_header X-Forwarded-Host $host;        proxy_set_header X-Forwarded-Server $host;        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;        proxy_pass http://localhost:8091/synchrony;        proxy_http_version 1.1;        proxy_set_header Upgrade $http_upgrade;        proxy_set_header Connection "Upgrade";    }

?


author: Aleksei Grishchenko
body: even with this part of code doesnt work.


Tags: http

nginx

url