Author SHA1 Message Date
Liosha84andClaude Opus 5.5 48ac16bb2f fix(compose): limit frontend memory to 64m
On Jambotron the project memory budget is split equally between services
without their own limit, so nginx got 341 MB while the backend was at 80%
of its share. With 64m for the frontend the backend and the database get
about 480 MB each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 22:49:52 +02:00
Liosha84 781a1d3fc9 Merge pull request 'fix: вход за прокси Caddy (forwarded headers, 403 CORS)' (#3) from fix/forwarded-headers into main 2026-10-17 22:30:14 +02:00
Liosha84andClaude Opus 5.5 7f2c1ec282 fix: trust proxy forwarded headers so login works behind Caddy
Behind Jambotron's Caddy the app saw http while the browser used https,
so same-domain requests looked cross-origin and @CrossOrigin answered
403 on /api/auth/signin. server.forward-headers-strategy=framework makes
the app use X-Forwarded-Proto/Host; app.origin can be set via APP_ORIGIN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 22:29:31 +02:00
Liosha84 b28f2a8b9c Merge pull request 'Доделать demo-decoupled' (#2) from feature/1-finish-demo into main 2026-10-17 19:43:34 +02:00
3 changed files with 17 additions and 2 deletions
+3
View File
@@ -48,6 +48,9 @@ services:
condition: service_healthy condition: service_healthy
ports: ports:
- "8081:80" - "8081:80"
# nginx со статикой хватает 64 МБ. На Jambotron бюджет памяти проекта делится поровну между
# сервисами без своего лимита — так backend и база получат больше
mem_limit: 64m
networks: networks:
- demo-decoupled - demo-decoupled
+7 -1
View File
@@ -1,3 +1,9 @@
# Схема исходного запроса: за Caddy (https) — из его X-Forwarded-Proto, иначе своя
map $http_x_forwarded_proto $forwarded_proto {
default $http_x_forwarded_proto;
"" $scheme;
}
server { server {
listen 80; listen 80;
server_name _; server_name _;
@@ -12,7 +18,7 @@ server {
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $forwarded_proto;
} }
# Маршруты Angular (/admin, /tutorials/1 ...) отдаём через index.html # Маршруты Angular (/admin, /tutorials/1 ...) отдаём через index.html
+7 -1
View File
@@ -24,4 +24,10 @@ app:
# Совпадает со сроком жизни cookie (24 ч), иначе UI считает пользователя вошедшим, а API отвечает 401 # Совпадает со сроком жизни cookie (24 ч), иначе UI считает пользователя вошедшим, а API отвечает 401
jwtExpirationMs: 86400000 jwtExpirationMs: 86400000
jwtCookieName: demo-decoupled jwtCookieName: demo-decoupled
origin: http://localhost:4200 # Разрешённый origin для запросов с другого домена (dev-сервер Angular). UI через nginx фронта CORS не касается
origin: ${APP_ORIGIN:http://localhost:4200}
# За обратным прокси (nginx фронта, Caddy Jambotron) приложение видит http. Без X-Forwarded-Proto/Host
# запросы со своего https-домена выглядят кросс-доменными, и CORS отвечает на них 403
server:
forward-headers-strategy: framework