AWS Nginx and Confluence
Asked by Steve Boydon:

Hi,

So trying to setup Confluence on AWS with Nginx proxying to Tomcat.

I have two EC2s one for Nginx and one for Tomcat and Confluence.

AWS Security groups are set up to allow port 8090 from nginx security group.

I have tested using command line from nginx to confluence instance using private dns and :8090. The setup page returns fine so I know nginx instance can see the private IP.

I have done very basic config settings and am not yet using HTTPS (my next journey)

So for sites-enabled confluence.conf I have

<br />

server {  
listen 80 default_server;  
listen \[::\]:80 default_server;  

server_name confluence.xxx.co.uk;  

<br />

location /confluence {  
client_max_body_size 100m;  
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://ip-xxx.xxx.xxx.xxx.eu-west-2.compute.internal:8090>;  
}  
}  

<br />

No errors when starting Nginx so syntax seems fine.

Confluence server.xml is

\<Server port="8000" shutdown="SHUTDOWN" debug="0"\>  
\<Service name="Tomcat-Standalone"\>  
\<!--  
==============================================================================================================  
DEFAULT - Direct connector with no proxy, for unproxied HTTP access to Confluence.  

If using a http/https proxy, comment out this connector.  
==============================================================================================================  
--\>  
\<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"/\>  

<br />

\<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\>  

<br />

Using this config it just times out and doesn't connect.

Any help appreciated

rgds

Steve


Answers:
author: Steve Boydon
body: All sorted now. Security groups were fine. I think there is a slight bug in ,6.15.4. a used 6.13 4 the same as on another device, and it now works


author: Danyal Iqbal
body: The config looks ok on first glance. I would investigate the security group again. ( Maybe allow everything and get it working first and than restrict to the relevant port and restet)

comments: author: Steve Boydon
body: I've tried that :)

Going back to basics.

thx

Steve


Tags: nginx