Skip to content

fix(nginx plugin): Put mime.types where nginx.conf expects it (#2908)#2909

Open
jefft wants to merge 1 commit into
jetify-com:mainfrom
jefft:jefft/nginx-plugin-fix-2908
Open

fix(nginx plugin): Put mime.types where nginx.conf expects it (#2908)#2909
jefft wants to merge 1 commit into
jetify-com:mainfrom
jefft:jefft/nginx-plugin-fix-2908

Conversation

@jefft

@jefft jefft commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

nginx starts with -p $NGINX_PATH_PREFIX, where -p means "set the prefix path". However this only affects the runtime path (for directives root, error_log, access_log etc). Relative configuration directives, like include mime.types;, are still resolved relative to nginx.conf. Therefore mime.types must go in {{ .DevboxDir }}, not {{ .Virtenv }}.

Fixes #2908

How was it tested?

rm -rf /tmp/testnginx && \
mkdir /tmp/testnginx && \
cd /tmp/testnginx && \
devbox init && \
devbox add nginx
ls  devbox.d/nginx/mime.types    # file exists
devbox services up

nginx now comes up on port 8081, whereas previously it died with open() "/tmp/testnginx/devbox.d/nginx/mime.types" failed.

Community Contribution License

All community contributions in this pull request are licensed to the project
maintainers under the terms of the
Apache 2 License.

By creating this pull request, I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 License as stated in
the
Community Contribution License.

…-com#2908)

nginx starts with -p $NGINX_PATH_PREFIX, where -p means "set the prefix
path". However this only affects the runtime path (for directives
`root`, `error_log`, `access_log` etc). Relative configuration
directives, like `include mime.types;`, are still resolved relative to
`nginx.conf`. Therefore mime.types must go in `{{ .DevboxDir }}`, not
`{{ .Virtenv }}`.

Fixes jetify-com#2908
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

nginx plugin broken due to misplaced mime.types

1 participant