Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,297,849
Community Members
 
Community Events
165
Community Groups

Error when installing plugin to a Jira server behind Nginx

Edited

Hi all,

I am trying to install the ScriptRunner plugin to my Jira server however I got a strange error. When I select the plugin jar and click "Upload", behind the pop-up I got following error:

error1.JPG

"An unexpected error occured. Refer to log file..."

(By the way, I couldn't find the "log file" so I am just guessing the error.)

I searched for the problem and find this page which is the same problem but in Stash.

 

So, I thought it may because of my configuration.

Currently, I can access the Jira from https://jira.domain.com in my domain.

 

My connector in server.xml:

<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxHttpHeaderSize="8192" SSLEnabled="true"
maxThreads="150" minSpareThreads="25"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2,TLSv1.3"
clientAuth="false" useBodyEncodingForURI="true"
keystoreFile="/Atlassian/cert.pfx" keystorePass="certpass" keystoreType="PKCS12"
relaxedPathChars="[]|" relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;"/>

 

And my configuration for nginx:

upstream jira.domain.com {
server 127.0.0.1:8443;
}

server {
listen 80;
server_name jira.domain.com;
rewrite ^(.*) https://$host$1 permanent;
}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;

server_name jira.domain.com;

proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;

# Add Headers for proxy mode
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;

# SSL
ssl on;
ssl_certificate /etc/nginx/certs/domainCert.crt;
ssl_certificate_key /etc/nginx/certs/domainCert.key;

ssl_session_timeout 30m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers <some long cipher text>;
ssl_prefer_server_ciphers on;

# logging
access_log /var/log/nginx/jira.access.log;
error_log /var/log/nginx/jira.error.log warn;


location / {
proxy_redirect off;
# Attachment file size limit
client_max_body_size 32M;
proxy_pass https://jira.domain.com;
}

# gzip
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
gzip on;
}

 

By the way, my Jira version is Jira server v8.0.0.

What may be the cause of this problem and how can I solve that?

 

------

EDIT:

When I disable the nginx and serve Jira through 8080 with its default configuration, I was able to upload the plugin.

What should be my configuration for nginx?

-----

 

Thanks

2 answers

1 accepted

1 vote
Answer accepted

Solved the problem. Cause was the proxy configuration!

I change my connector in server.xml like Jira's suggestion:

<Connector port="8080" 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="jira.domain.com" proxyPort="443"/>

Also, my new nginx configuration is as following:

server {
listen 80;
server_name jira.domain.com;
root /usr/share/nginx/html;

location / {

return 301 https://$host$request_uri;
}

}

server {
listen 443 ssl;
server_name jira.domain.com;
root /usr/share/nginx/html;


ssl_session_cache shared:SSL:1m;

access_log /var/log/nginx/jira.access.log;
error_log /var/log/nginx/jira.error.log warn;

ssl_certificate /etc/nginx/certs/domainCert.crt;
ssl_certificate_key /etc/nginx/certs/domainCert.key;


ssl_session_timeout 10m;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers '!DHE-DSS-AES256-GCM-SHA384:!DHE-RSA-AES256-GCM-SHA384:!DHE-RSA-AES256-SHA256:!DHE-DSS-AES256-SHA256:!DHE-RSA-AES256-SHA:!DHE-DSS-AES256-SHA:!DHE-RSA-CAMELLIA256-SHA:!DHE-DSS-CAMELLIA256-SHA:!DHE:!MD5:!RC4:!EXPORT:!aNULL:!eNull:!DHE-RSA-AES128-GCM-SHA256:!DHE-RSA-AES128-CBC-SHA256:kEECDH+ECDSA+AES128:kEECDH+ECDSA+AES256:kEECDH+AES128:kEECDH+AES256:kEDH+AES128:kEDH+AES256:+SHA:!aNULL:!eNULL:!LOW:!kECDH:!DSS:!MD5:!EXP:!PSK:!SRP:!CAMELLIA:!SEED:!3DES';#

location /secure/ForgotLoginDetails.jspa {
return 301 https://jira.domain.com;
}

location / {
client_max_body_size 100m;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8080;
}
}

Hi, @stuck 

How to find this XML files ?

Suggest an answer

Log in or Sign up to answer
TAGS

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