fix: prevent duplicate nginx location block for Laravel apps - #7893
Open
fzengin19 wants to merge 1 commit into
Open
fix: prevent duplicate nginx location block for Laravel apps#7893fzengin19 wants to merge 1 commit into
fzengin19 wants to merge 1 commit into
Conversation
Fixes coollabsio#7867 When deploying Laravel applications with Nixpacks, the nginx configuration was failing with 'duplicate location "/"' error. Root cause: - Nixpacks nginx template has two conditional 'location /' blocks: 1. When IS_LARAVEL=true (detected automatically for Laravel apps) 2. When NIXPACKS_PHP_FALLBACK_PATH is set - Coolify was setting NIXPACKS_PHP_FALLBACK_PATH for Laravel apps, causing both conditions to be true and creating duplicate blocks. Solution: - Remove NIXPACKS_PHP_FALLBACK_PATH for Laravel apps since IS_LARAVEL=true already configures the correct nginx routing. - Keep NIXPACKS_PHP_ROOT_DIR to ensure proper public directory configuration. Tested with TALL stack (Tailwind, Alpine, Livewire, Laravel) project containing both composer.json and package.json - nginx now starts correctly.
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.
Fixes #7867
When deploying Laravel applications with Nixpacks, the nginx configuration was failing with 'duplicate location "/"' error.
Root cause:
Solution:
Tested with TALL stack (Tailwind, Alpine, Livewire, Laravel) project containing both composer.json and package.json - nginx now starts correctly.