nginx proxy not able to redirect to bamboo server instance

I am  very new to the nginx implementation. .


Bamboo-1 server url : https://<bamboo1-server>.domain.com/;

As per my understanding,

I have implemented SSL(self signed) in the nginx server and now default.conf looks as below

erver {

listen 443;
server_name <nginx-server>;

ssl on;
ssl_certificate /etc/nginx/ssl/.crt;
ssl_certificate_key /etc/nginx/ssl/.key;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
}

location /bamboo1 {

proxy_pass https://<bamboo1-server>.domain.com/;



 

https://<proxy-server>/bamboo1 is giving 404 error. I don't want to configure context root in application side.

Please let me know if  this is feasible. 

2 answers

Hello,

 

So you need to configure your tomcat (server.xml) in Bamboo with kind of the following:

&lt;Connector port="7990" 
     protocol="HTTP/1.1"
     connectionTimeout="20000"
     useBodyEncodingForURI="true"
     redirectPort="443"
     compression="on"
     compressableMimeType="text/html,text/xml,text/plain,text/css,application/json,application/javascript,application/x-javascript"
     secure="true"
     scheme="https"
     proxyName="mycompany.com" 
     proxyPort="443" /&gt;

 

Then you have to setup nginx with Bamboo:

 

server {
	listen          443;
    server_name     mycompany.com;
	
	ssl                  	on;
    ssl_certificate      	&lt;path/to/your/certificate&gt;;
    ssl_certificate_key  	&lt;path/to/your/certificate/key&gt;;
    ssl_session_timeout  	5m;
    ssl_protocols  			TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers  			HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers   on;
	
	# Optional optimisation - please refer to http://nginx.org/en/docs/http/configuring_https_servers.html
	# ssl_session_cache   shared:SSL:10m;
    location / {
        proxy_pass 			http://localhost:7990;
		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_set_header    X-Real-IP $remote_addr;
		proxy_redirect 		off;
    }
}
nginx -s reload

If you are using Linux servers that have hardening options on you have to configure those. 

 

All the configuration looks fine in my implementation.  My question was around context root.

 

I want to access https://<proxy-name>/bamboo1 without configuring the respective context root (/bamboo1) defining in bamboo server.xml. 

 

My NGINX implementation is working well when i configured bamboo1 as context root in server.xml, but without context root https://<proxy-name>/bamboo1 giving 404 erro

404 comes as page not found which is probably cause you are defining your bamboo server url wrong.

 

So what you are doing is pointing your server like this

My reverse proxy > connect to bamboo using proxy pass my reverse proxy > bamboo are you there in the reverse proxy? > return 404

 

Your proxy pass configuration is supposed to link to the bamboo address: 

 Like following:

location /bamboo1 {
        proxy_pass          http://bambooserver:bambooPort;
    
    }

As i mentioned above my proxy_pass configuration is same as you mentioned, but giving 404 error.

 

location /bamboo1 { 

proxy_pass https://bamboo1-server:port;

Are you using HTTPS in the Bamboo server also? Cause if not then it should be http.

Yes , i am using https in bamboo server. 

Which server are you using? 

Does it have SELinux? If yes have you checked that it doesn't stop anything?

 

Are you exiting the same domain? (Do you need to create CORS?)

 

The address answers from the proxy server?  

All the configuration looks fine in my implementation.  My question was around context root.

 

I want to access https://<proxy-name>/bamboo1 without configuring the respective context root (/bamboo1) defining in bamboo server.xml. 

 

My NGINX implementation is working well when i configured bamboo1 as context root in server.xml, but without context root https://<proxy-name>/bamboo1 giving 404 error.

 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,572 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you