Jira8 behind Nginx proxy - gadget.common.error.500

Cyber365 February 17, 2019

image.png

 

catalina.out

17-Feb-2019 15:40:50.258 WARNING [http-nio-8082-exec-4] com.sun.jersey.spi.container.servlet.WebComponent.filterFormParameters A servlet request, to the URI https://mydomain.com/rest/activity-stream/1.0/preferences?_=1550418046548, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.

 

 

 

1 answer

0 votes
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 19, 2019

Hello,

Your base URL in Jira needs to have the URL that the proxy listens to. Could you confirm that? 

Proxies. If you are running behind a proxy, ensure that the proxy name matches the base URL.  For example: proxyName="foobar.com" proxyPort="443" scheme="https". This will make sure we are passing the information correctly.

In addition, I would recommend you review the following article to resolve the issue:

Let me know if you have any trouble.

Shannon

Cyber365 February 24, 2019

Hi Shannon,

I tried and found a problem when using a subdomain has number character, for example, jira8.foobar.com

<Connector port="8082" relaxedPathChars="[]|" relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;"
maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false"
maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443"
acceptCount="100" disableUploadTimeout="true" bindOnInit="false" secure="true" scheme="https"
proxyName="jira8.foobar.com" proxyPort="443"/>

if only use the letter in a subdomain, for example, jira.foobar.com then this is ok

Do you have any way to fix it?

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 1, 2019

Thanh,

Can you confirm then that jira8.foobar.com matches your base URL as well? It needs to match exactly.

Regards,
Shannon

Cyber365 March 4, 2019

Yes, it matches exactly, I tried many times,

image.pngimage.png

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 4, 2019

Thank you for confirming. 

Next step would be for us to take a look at the the conf file for your NGINX server that's creating the proxy.

Could you please share that information? You can block out any sensitive details.

Regards,

Shannon

Cyber365 March 5, 2019

yes of course, 

upstream jirastreamv8https {
server x.x.x.x:8082;
}

server {

listen jira8.foobar.com:80;
server_name jira8.foobar.com;
location / {

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://jirastreamv8https;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;

client_max_body_size 10M;

}

return 301 https://$server_name$request_uri;

}


server {

listen jira8.foobar.com:443 ssl;
server_name jira8.foobar.com;

ssl on;
ssl_certificate /etc/letsencrypt/live/foobar.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/foobar.com/privkey.pem;

location / {

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://jirastreamv8https;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;

client_max_body_size 10M;

}

}
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 6, 2019

Thanh,

Thank you!

So it looks like the following section is what's causing your gadget error:

Screen Shot 2019-03-06 at 2.48.23 PM.png

You want to remove the location block and redirect to serve on 80. Essentially you're allowing requests to be shared at http:// and Jira is only writing URLs at https://. This is two separate URLs technically, so it's causing the issue.

Give that a try and let me know if you have any trouble.

Regards,

Shannon

hamza zammel April 3, 2019

i have the same issue. i did what you suggested but it still does not work. any help?

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 4, 2019

Hamza,

Thank you for reaching out! This was very particular to Thanh's configuration. The case is that you might also have a misconfiguration in your conf file.

I would recommend that you either raise a Support Request or a new question here on Community and share the details of your conf file, and we can have a look for you.

Regards,

Shannon

Suggest an answer

Log in or Sign up to answer