It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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
Community showcase
Published in Bamboo

Unable to add or edit Bitbucket Cloud repository in Bamboo

On 31 May, a GDPR-related change went live in the Bitbucket Cloud API that resulted in users not being able to create or edit Bitbucket Cloud Linked repositories in Bamboo. This API update removed t...

307 views 2 6
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you