Defect #41232
closedAttachment-URLs in API not honouring set host name
0%
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).
Updated by Holger Just 2 months 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.