From 6fa4ed96c856bfc3591992c2f894aad5ef45f0a2 Mon Sep 17 00:00:00 2001 From: silverpill Date: Wed, 22 Feb 2023 14:53:05 +0000 Subject: [PATCH] Add proxy_set_header directive for X-Forwarded-Proto header --- CHANGELOG.md | 5 +++++ contrib/mitra-alt-fe.nginx | 1 + contrib/mitra.nginx | 1 + 3 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9354f1b..2fb3b56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Documented `http_cors_allowlist` configuration parameter. - Added `/api/v1/statuses/{status_id}/thread` API endpoint (replaces `/api/v1/statuses/{status_id}/context`). - Accept webfinger requests where `resource` is instance actor ID. +- Added `proxy_set_header X-Forwarded-Proto $scheme;` directive to nginx config example. ### Changed @@ -22,6 +23,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Changed `/api/v1/statuses/{status_id}/context` response format to match Mastodon API. - Changed status code of `/api/v1/statuses` response to 200 to match Mastodon API. +### Deprecated + +- Deprecated protocol guessing on incoming requests (use `X-Forwarded-Proto` header). + ### Fixed - Fixed actor object JSON-LD validation errors. diff --git a/contrib/mitra-alt-fe.nginx b/contrib/mitra-alt-fe.nginx index cef9587..9637efc 100644 --- a/contrib/mitra-alt-fe.nginx +++ b/contrib/mitra-alt-fe.nginx @@ -48,6 +48,7 @@ server { # Backend proxy_pass http://127.0.0.1:8383; proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $remote_addr; } } diff --git a/contrib/mitra.nginx b/contrib/mitra.nginx index c8d0a62..3ff06b9 100644 --- a/contrib/mitra.nginx +++ b/contrib/mitra.nginx @@ -41,6 +41,7 @@ server { location / { proxy_pass http://127.0.0.1:8383; proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $remote_addr; } }