jira无法正常显示图片

jira安装之后,图片在富文本编辑器内能正常显示,但是在附件内无法显示,如果查看会发现图片的连接是127.0.0.1.

nginx原始配置如下:

server{
  listen 80;
  server_name jira.test.net; # 公网ip
  index  index.php index.html index.htm;

  location / {
    proxy_pass  http://127.0.0.1:8002;
    proxy_set_header Host $proxy_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}

将proxy地址设置为公网,并且修改为以下配置就可以正常访问了:

server{
  listen 80;
  server_name jira.test.net; # 公网ip
  index  index.php index.html index.htm;



  location / {
    proxy_pass  http://47.xxx.xxx.12:8002;
                proxy_redirect          off;
                proxy_set_header        Host $host:$server_port;   ##重点在$server_port
                proxy_set_header        X-Real-IP $remote_addr;
                proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_max_temp_file_size 0;
                proxy_connect_timeout 90;
                proxy_send_timeout 90;
                proxy_read_timeout 90;
                proxy_buffer_size 4k;
                proxy_buffers 4 32k;
                proxy_busy_buffers_size 64k;
                proxy_hide_header Vary;
                proxy_set_header Accept-Encoding '';
                proxy_set_header Referer $http_referer;
                proxy_set_header Cookie $http_cookie;

}
}