fix(nginx plugin): place mime.types next to nginx.conf so include resolves#2929
Open
mikeland73 wants to merge 1 commit into
Open
fix(nginx plugin): place mime.types next to nginx.conf so include resolves#2929mikeland73 wants to merge 1 commit into
mikeland73 wants to merge 1 commit into
Conversation
…olves
The nginx plugin created mime.types in the Virtenv directory
({{ .Virtenv }}/mime.types), but nginx.conf lives in the DevboxDir and
uses a relative "include mime.types;" directive. nginx resolves config-time
include paths relative to the config file, not the -p prefix path, so the
service failed to start with:
[emerg] open() ".../devbox.d/nginx/mime.types" failed (2: No such file
or directory) in .../devbox.d/nginx/nginx.conf
Place mime.types in the DevboxDir alongside nginx.conf (matching how
fastcgi.conf is already handled) and bump the plugin version.
Fixes #2908
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013yJQ9FtijMB9SfnTeRVC1P
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the nginx plugin startup failure caused by include mime.types; being resolved relative to the generated nginx.conf location (in devbox.d/nginx/), while mime.types was previously created under the virtenv prefix.
Changes:
- Bump nginx plugin version from
0.0.5to0.0.6so existing environments pick up the fix. - Relocate
mime.typescreation from{{ .Virtenv }}to{{ .DevboxDir }}soinclude mime.types;resolves during config parsing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Fixes #2908.
The nginx plugin currently fails to start because it cannot find its
mime.typesfile:Root cause: PR #2844 added
include mime.types;tonginx.confand created themime.typesfile at{{ .Virtenv }}/mime.types(.devbox/virtenv/nginx/mime.types), under the assumption thatnginx -p $NGINX_PATH_PREFIXwould make the relativeincluderesolve against the prefix path. In fact nginx only uses the-pprefix for runtime paths (error_log,access_log,root, …); at configuration time, relativeincludepaths are resolved relative to thenginx.conffile itself, which devbox places in theDevboxDir(devbox.d/nginx/).Fix: Create
mime.typesin theDevboxDiralongsidenginx.conf, so the relativeinclude mime.types;resolves correctly. This mirrors how the plugin already handlesfastcgi.conf(also created inDevboxDir). The plugin version is bumped0.0.5→0.0.6so existing environments pick up the relocated file.How was it tested?
plugins/nginx.jsonremains valid JSON.nginx.confis created at{{ .DevboxDir }}/nginx.confand uses a relativeinclude mime.types;; placingmime.typesin the sameDevboxDirmakes the include resolvable. Thefastcgi.conffile already follows this exact placement pattern.{{ .Virtenv }}/mime.typespath exist in the codebase, and the nginxenv.test.txttestscript does not assert on themime.typeslocation, so behavior is unchanged apart from the fix.Reproduction from the issue (
devbox add nginx && devbox services up -b) previously left the service failing with themime.types[emerg]error; withmime.typesplaced next tonginx.conf, the config-timeincluderesolves.cc @jefft (issue reporter)
Community Contribution License
All community contributions in this pull request are licensed to the project
maintainers under the terms of the
Apache 2 License.
Generated by Claude Code