Add proxy_set_header directive for X-Forwarded-Proto header

This commit is contained in:
silverpill 2023-02-22 14:53:05 +00:00
parent e1e9851d5c
commit 6fa4ed96c8
3 changed files with 7 additions and 0 deletions

View file

@ -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. - Documented `http_cors_allowlist` configuration parameter.
- Added `/api/v1/statuses/{status_id}/thread` API endpoint (replaces `/api/v1/statuses/{status_id}/context`). - 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. - Accept webfinger requests where `resource` is instance actor ID.
- Added `proxy_set_header X-Forwarded-Proto $scheme;` directive to nginx config example.
### Changed ### 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 `/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. - 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
- Fixed actor object JSON-LD validation errors. - Fixed actor object JSON-LD validation errors.

View file

@ -48,6 +48,7 @@ server {
# Backend # Backend
proxy_pass http://127.0.0.1:8383; proxy_pass http://127.0.0.1:8383;
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-For $remote_addr;
} }
} }

View file

@ -41,6 +41,7 @@ server {
location / { location / {
proxy_pass http://127.0.0.1:8383; proxy_pass http://127.0.0.1:8383;
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-For $remote_addr;
} }
} }