Project

General

Profile

Actions

Defect #41232

closed

Attachment-URLs in API not honouring set host name

Added by D. Au 28 days ago. Updated 25 days ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Plugin API
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

Host name and path is set in settings, nevertheless API call /issues/123.json?include=attachments lists content_url items with "http://{ip}:{port}".

Redmine running on {ip}:{port} behind nginx proxy via bundle exec rails server. URLs in mails correctly include set host name and protocol ("https" provided by proxy).

Actions #1

Updated by Holger Just 25 days ago

  • Status changed from New to Closed

Several places in Redmine (including the generation of redirect URLs, some API methods, and other places) leverage the given Host header in the current request to generate full URLs.

Thus, you have to pass on the original Host header to Redmine as well as an indication whether the original request to nginx was made over https. For that, you need to include the following settings into your proxy block:

proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;

Please refer to the documentation of the proxy_set_header rule in nginx for more details and possible adaptations depending on your setup.

Actions

Also available in: Atom PDF