Files
admin/.tasks-imported/cms-maljarka-https-mode-bug-fix.md
vitya 85b3ee847f import-stage: .tasks/ via split (temp prefix, await STATUS.md merge)
git-subtree-dir: .tasks-imported
git-subtree-mainline: c40418239e
git-subtree-split: cbdc2b39aa
2026-05-21 13:48:02 +03:00

53 lines
3.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# cms-maljarka-https-mode-bug-fix
## Goal
Починить `maljarka.tandemmebel.ru` чтобы он отвечал 200 (не 502) через публичный HTTPS chain. Root cause diagnosed в [[traefik-maljarka-502-bug]]: IIS+CMS падает на этом hostname когда `HTTPS=on`/`SERVER_PORT=443` выставлены URL Rewrite rule'ом. Full mechanism — wiki concept [[cms-maljarka-https-mode-crash]].
## Key files
- `C:\sites\snolla\Web.config` — URL Rewrite rule "ForwardedProto-HTTPS" из [[cms-server-port-leak-fix]]
- `C:\inetpub\logs\LogFiles\W3SVC*\` — IIS logs site `snolla` (нужно найти sub-status 502.x для конкретного request)
- CMS DB — table с per-host config (per [[recovery-architecture-snapshot]], CMS использует MSSQL контейнер)
- CMS source: `MoreThenCms.Admin\Mis\Web\Mvc\UrlHelpers\UrlHelpers.cs:14-37` (`Url.SiteRoot()`) — паттерн из [[cms-server-port-leak-fix]]; возможно тут helper падает specifically на этом host
## Bisect-trace evidence
```
direct backend Host: maljarka.tandemmebel.ru → 200 OK (43KB)
direct backend Host: maljarka.tandemmebel.ru + X-Forwarded-For → 200 OK
direct backend Host: maljarka.tandemmebel.ru + X-Forwarded-Proto:https → 502 ← триггер
direct backend Host: tandemmebel.ru + X-Forwarded-Proto:https → 301 (correct)
```
Single variable: `X-Forwarded-Proto: https` для этого specific hostname.
## Next action
1. **IIS logs**:
```powershell
Get-Content 'C:\inetpub\logs\LogFiles\W3SVC1\u_extend1*.log' -Tail 500 | Select-String 'maljarka' | Select-Object -Last 20
```
Найти sub-status (502.3 = bad gateway, 502.4 = no server, 502.5 = ARR config, etc.).
2. **Event Viewer**:
```powershell
Get-EventLog -LogName Application -Source 'ASP.NET*' -Newest 50 | Where-Object Message -Match 'maljarka' | Format-List
```
Stack trace покажет точное место crash.
3. **CMS DB inspection** — есть ли запись для `maljarka.tandemmebel.ru` в table с per-host URLs, и поле HttpsUrl/BaseUrl не NULL ли там.
4. **Quick workaround если real customer traffic** — apply Workaround B из [[cms-maljarka-https-mode-crash]] (negate condition в URL Rewrite rule for this Host). Backup Web.config first.
## Open questions
- [ ] Какой priority? Зависит от того real customer traffic на `maljarka.tandemmebel.ru` или это internal/test subdomain.
- [ ] Если CMS bug — fix CMS code или DB hot-fix?
- [ ] DLL patch для null-guard (от [[cms-admin-assets-root-folders-seed]]) — может тот же класс bugов; может в одном вылазе чинить вместе.
## Notes
- 3 workarounds + 5 investigation places задокументированы в [[cms-maljarka-https-mode-crash]] wiki concept.
- Не trivially связан с [[cms-server-port-leak-fix]] — там URL Rewrite rule добавлен правильно, но CMS код в этом конкретном случае ломается. Регрессия CMS, не fix'а.