OAuth: nginx proxy to link confluence with jira
Asked by contact@zoumra.com:

Hello,

trying to clear out the following error when linking jira and confluence:

/rest/applinks/3.0/status/71b63d68-c19a-3ae4-8b5f-29ec14ddfd94 \[c.a.a.i.migration.remote.TryWithCredentials\] You do not have an authorized access token for the remote resource

The network error prevents both jira and confluence working together, but then my proxy works fin for a separate access:

jira. conf -\>

server {  
listen 10.0.1.250:80;  
server_name jira.example.net;  
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://10.0.2.70:8080>;  
client_max_body_size 100M;  
}  
}

confluence.conf -\>

server {  
listen 10.0.1.249:80;  
server_name confluence.example.net;  
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://10.0.2.80:8090>;  
client_max_body_size 100M;  
}  
location /synchrony {  
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://10.0.2.80:8091/synchrony>;  
proxy_http_version 1.1;  
proxy_set_header Upgrade $http_upgrade;  
proxy_set_header Connection "Upgrade";  
}  
}


Answers:
author: somethingblue
body: Hi,

* When you say they do not work together what do you mean by that?

I believe your issue is addressed in [Unable to Search or View JIRA and Confluence links due to "RequestHeader unset Authorization.](https://confluence.atlassian.com/jirakb/unable-to-search-or-view-jira-and-confluence-links-due-to-requestheader-unset-authorization-874615178.html)" While you appear to be using different subdomains, the domain is the same:

* server_name jira.example.net;
* server_name confluence.example.net;

The [article I mentioned](https://confluence.atlassian.com/jirakb/unable-to-search-or-view-jira-and-confluence-links-due-to-requestheader-unset-authorization-874615178.html) above lists the following symptoms:
> **From JIRA:**
>
> * Can't search for Confluence pages to link to JIRA issues
> * Existing links show: "You do not have permission to view this page"
>
> **From Confluence:**
>
> * Can't search for JIRA issues to include in Confluence pages
> * Existing links show: "JIRA issue doesn't exist or you don't have permission to view it"
>
> The following appears in the `atlassian-jira.log:`  
>
>     2017-02-24 21:54:23,826 http-nio-2786-exec-3 WARN admin 1314x277x2 rf4lxg 192.168.1.100,192.168.1.100 /rest/applinks/3.0/status/e87b0b73-eaa1-3493-bc27-a5bd27a7de29 [c.a.a.i.migration.remote.TryWithCredentials] You do not have an authorized access token for the remote resource.
>
The following appears in the `atlassian-confluence.log:`  
>
>     2017-02-24 21:53:51,093 WARN [http-nio-2782-exec-2] [internal.migration.remote.TryWithCredentials] execute You do not have an authorized access token for the remote resource. -- referer: http://andynguyen.vn/cfl/admin/listapplicationlinks.action | url: /cfl/rest/applinks/3.0/status/b2693708-529b-3dda-804b-9c1a6d3e78e5 | traceId: a41148e6656babee | userName: admin

[The article](https://confluence.atlassian.com/jirakb/unable-to-search-or-view-jira-and-confluence-links-due-to-requestheader-unset-authorization-874615178.html) lists the cause as follows:  
> The VirtualHost for the domain in the proxy config contains this parameter: **RequestHeader unset Authorization**.
>
> :warning: If JIRA and Confluence use different domains (different VirtualHosts), the parameter doesn't take effect and the problem doesn't happen.  

To resolve the issue it is recommended to **remove the parameter RequestHeader unset Authorization from the VirtualHost config** and **restart** the proxy.

Try that and let me know if it helps!

Cheers,

Branden

comments: author: contact@zoumra.com
body: Hello Branden,

thanks for your feedback.

Indeed jira/confluence are subdomains , then adding following vhost directives in nginx:

server {

#proxy_hide_header Authorization;  
proxy_set_header Authorization "";

...

}

in jira.conf and confluence.conf, did not resolve the issue.

Is there something wrong


author: Dmitrii
body: Link applications and Jira user server is not work revers proxy. Create new coonector. {#toc-hId--1301949500}
-------------------------------------------------------------------------------------------------------------

<https://confluence.atlassian.com/kb/how-to-create-an-unproxied-application-link-719095740.html> {#toc-hId-1185563333}
----------------------------------------------------------------------------------------------------------------------

I've been trying to set it up for a week, thinking that the problem is in NGINX, but it turned out that it basically does not work through it. I hope the next person finds this information faster than me.  


Tags: application-link

jira

nginx

oauth