Skip to content

Conversation

@ricardomm85
Copy link
Contributor

👉 Describe the problem

The current Nginx configuration separates SVG files from other media assets. This creates an inconsistency with how Symfony's Asset Mapper component handles assets, particularly in development environments where SVG files should be served through PHP just like other media assets.

👥 Problem evidence & reach

This affects all developers using Symfony's Asset Mapper with this Nginx configuration. The inconsistent handling causes problems in development environments where Asset Mapper needs to serve versioned SVG files through PHP, but the Nginx configuration doesn't forward these requests correctly.

🏆 How to solve this problem

Move the SVG file handling from the "svg, fonts" location block to the "assets, media" location block to align with Asset Mapper's handling of assets in both development and production environments.

🥰 Describe the "impact" on users?

This change will provide seamless integration with Symfony's Asset Mapper component. In development, SVG files will be properly served through the PHP application, allowing for dynamic versioning. In production (after running asset-map:compile), they'll be served directly by Nginx with appropriate caching headers. Developers will have a more consistent experience across environments and won't encounter issues specific to SVG files.

💯 How do we validate the problem is solved?

  • In development: Versioned SVG files (like /assets/images/logo-3c16d92m.svg) should be correctly handled by the PHP application
  • In production: After running asset-map:compile, SVG files should be served directly from the filesystem with proper caching
  • Confirm there are no 404 errors for SVG assets in either environment

@jaydrogers jaydrogers changed the base branch from main to 280-create-a-frankenphp-variation September 23, 2025 14:42
@jaydrogers jaydrogers moved this to 🤔 Evaluating in serversideup/php v4.0 Sep 23, 2025
@jaydrogers
Copy link
Member

jaydrogers commented Oct 2, 2025

Thanks for the detailed explanation! This makes sense.

I don't know how I put svgz in with the fonts. This could have been adapted from an old config I started running years ago 😃

I greatly appreciate your efforts to help me understand what was going on here.

Update: Forgot to add, this will be made available in v4.0

@jaydrogers jaydrogers merged commit 2b5cd7b into serversideup:280-create-a-frankenphp-variation Oct 2, 2025
@github-project-automation github-project-automation bot moved this from 🤔 Evaluating to Done in serversideup/php v4.0 Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants