Skip to content

Fix ASSET_URL not reaching PHP-FPM behind reverse proxy (#2026)#2182

Draft
lancepioch wants to merge 2 commits intomainfrom
lance/2026
Draft

Fix ASSET_URL not reaching PHP-FPM behind reverse proxy (#2026)#2182
lancepioch wants to merge 2 commits intomainfrom
lance/2026

Conversation

@lancepioch
Copy link
Member

@lancepioch lancepioch commented Feb 6, 2026

PHP-FPM's clear_env default strips shell environment variables, so the exported ASSET_URL was never visible to Laravel. This persists it to .env where Dotenv can read it.

Fixes #2026

PHP-FPM's clear_env default strips shell environment variables, so the exported ASSET_URL was never visible to Laravel. This persists it to .env where Dotenv can read it.
@lancepioch lancepioch self-assigned this Feb 6, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • ✅ Review completed - (🔄 Check again to review again)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@lancepioch lancepioch requested a review from parkervcp February 6, 2026 07:45
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@docker/entrypoint.sh`:
- Around line 69-74: The current ASSET_URL write only targets /pelican-data/.env
which can miss the actual app .env when /var/www/html/.env is a non-symlink
file; update the entrypoint.sh ASSET_URL block to resolve the real target .env
(e.g., check if /var/www/html/.env exists and if it is a symlink use readlink -f
to get the real path, otherwise use /var/www/html/.env directly) and write or
sed to that resolved path, falling back to /pelican-data/.env only if the
resolved/app .env does not exist or is not writable; modify the ASSET_URL
handling in docker/entrypoint.sh to operate on the resolved_env_path variable
instead of hardcoding /pelican-data/.env so PHP‑FPM will see the change.
- Around line 70-72: The sed replacement for ASSET_URL uses the raw APP_URL
which can contain '&' or the '|' delimiter and corrupt /pelican-data/.env;
update the block that builds the sed command so APP_URL is escaped before being
used in the replacement (escape '&' and the chosen sed delimiter or switch to a
delimiter that is also escaped) and then use the escaped value in the sed
invocation that updates the ASSET_URL line; ensure you reference ASSET_URL and
APP_URL in the change so the replacement is safe for any APP_URL value.

@parkervcp
Copy link
Contributor

When I originally tested this caddy is where I set the asset_url and that resolved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assets load from IP instead of ASSET_URL (reverse proxy using traefik)

2 participants