Skip to content

Commit 6dcdfeb

Browse files
committed
fix: Fix static routing in kittygram gateway for admin and frontend assets.
Updated nginx config to split static file handling by path instead of using one generic `/static` fallback through `/`. Added explicit routes for Django admin and DRF static files (`/static/admin/`, `/static/rest_framework/`) and routed frontend bundles through `/static/` -> `/static/static/`. This resolves two regressions: white screen on frontend due to missing JS/CSS (`404 /static/js|css`) and unstyled Django admin due to wrong static resolution. Kept API/admin/media proxy behavior unchanged.
1 parent e94f203 commit 6dcdfeb

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

nginx/nginx.conf

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,20 @@ server {
1616
alias /media/;
1717
}
1818

19+
location /static/admin/ {
20+
alias /static/admin/;
21+
}
22+
23+
location /static/rest_framework/ {
24+
alias /static/rest_framework/;
25+
}
26+
27+
location /static/ {
28+
alias /static/static/;
29+
}
30+
1931
location / {
20-
alias /static/;
21-
try_files $uri $uri/ /index.html;
32+
root /static;
33+
try_files $uri /index.html;
2234
}
2335
}

0 commit comments

Comments
 (0)