Pass font requests to PHP for Symfony Asset Mapper compatibility - #710
Merged
jaydrogers merged 2 commits intoOct 1, 2026
Conversation
jaydrogers
changed the base branch from
main
to
release/webserver-improvements-and-fixes
October 1, 2026 16:43
…s-php-fallback-asset-mapper
jaydrogers
merged commit Oct 1, 2026
7dd0e0d
into
serversideup:release/webserver-improvements-and-fixes
Member
|
Thank you! This will be shipped in this release: |
Contributor
Author
|
Glad I could help! |
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.
👉 Describe the problem
#530 moved SVG out of the combined "svg, fonts" location block so Symfony Asset Mapper could serve versioned SVG files through PHP in development. The font filetypes that stayed behind in their own block still have no PHP fallback — unlike the "assets, media" and
robots.txtblocks, a font request that doesn't exist on disk is answered by nginx with a 404 and never reaches PHP.This breaks self-hosted fonts in development environments where the framework serves fonts virtually. With Symfony Asset Mapper (no
asset-map:compile), every page requests fonts from/assets/fonts/*.woff2, nginx 404s each one, and pages render with fallback fonts even though the application is configured correctly.👥 Problem evidence & reach
public/assets/), so every font request 404s at nginx. Verified onserversideup/php:8.5-fpm-nginx-debian-v4.5.1:curl /assets/fonts/<versioned>.woff2returns nginx's own 404 page while the same style of versioned.css/.jsrequest passes through to PHP and returns 200 — the only difference is the missing fallback in the fonts block.try_files $uriserves them directly, exactly as today; only requests nginx can't resolve fall through toindex.php, which is how the media block already behaves.🏆 How to solve this problem
Add the same
try_files $uri /index.php?$query_string;line and comment that the "assets, media" block already has to the "fonts" block, keeping theAccess-Control-Allow-Originand cache headers untouched.🥰 Describe the impact
asset-map:compile).