feat(nginx): strona błędu 500 per-domena z fallbackiem na generyczną#11
Merged
Conversation
W instalacji multi-hosted każda domena (Site/Uczelnia) ma własną stronę 500
z brandingiem swojej uczelni.
- error_page 500 przeniesiony z _bpp-locations.conf (includowany dosłownie,
bez envsubst — nie da się tam użyć ${VHOST_NAME}) do vhost.conf.template,
gdzie render script podstawia ${VHOST_NAME} przez envsubst.
- Każdy vhost: internal location /__bpp_500__ z try_files
/staticroot/500/<host>.html -> /staticroot/500.html -> =500. Per-domena gdy
istnieje, generyczny fallback gdy nie (zgodny z obrazami pre-multi-hosted).
Pliki produkuje appserver: manage.py generate_500_page w $STATIC_ROOT.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Co i dlaczego
W instalacji multi-hosted jeden nginx serwuje N domen (po jednym vhoście z
vhost.conf.template). Dotąderror_page 500 /static/500.htmlbył wspólny — wszystkie domeny dostawały tę samą stronę 500. Teraz każda domena ma własną stronę z brandingiem swojej uczelni.Zmiany
error_page 500przeniesiony z_bpp-locations.confdovhost.conf.template. Powód:_bpp-locations.confjest includowany przez nginx dosłownie (render script puszczaenvsubsttylko navhost.conf.template), więc${VHOST_NAME}da się użyć wyłącznie w templacie.location = /__bpp_500__ztry_files /staticroot/500/<host>.html → /staticroot/500.html → =500. Per-domena gdy istnieje; generyczny fallback gdy nie (zgodny z obrazami pre-multi-hosted); twardy=500na koniec.Skąd pliki
Produkuje je appserver w runtime:
manage.py generate_500_pagezapisuje do$STATIC_ROOT(wolumenstaticroot, widziany przez nginx pod/var/www/html/staticroot/). Parę aplikacyjna: iplweb/bppfeat/per-domain-500-page(PR #379).Uwaga
Per-domenowy plik trafia tylko gdy
Site.domain==${VHOST_NAME}zDJANGO_BPP_HOSTNAMES. Niedopasowanie → cichy, bezpieczny fallback na generyczną stronę.🤖 Generated with Claude Code