Skip to content

nginx plugin broken due to misplaced mime.types #2908

Description

@jefft

What happened?

The nginx plugin's service currently fails to start, as it cannot find the mime.types file:

2026/07/08 23:15:04 [emerg] 1582584#1582584: open() "/tmp/testnginx/devbox.d/nginx/mime.types" failed (2: No such file or directory) in /tmp/testnginx/devbox.d/nginx/nginx.conf:6

Background

nginx has a -p flag meaning "Set the prefix path". Devbox's nginx plugin runs nginx -p $NGINX_PATH_PREFIX (i.e. {{ .Virtenv }} / .devbox/virtenv/nginx), which causes error.log to go to the correct place.

What changed

A recent change #2844 added a include mime.types; directive to nginx.conf, and added $NGINX_PATH_PREFIX/mime.types file (.devbox/virtenv/nginx/mime.types). This location was picked under the reasonable but incorrect belief that nginx -p $NGINX_PATH_PREFIX means include mime.types; would be resolved to the -p path.

In fact nginx only seems to use -p path for runtime paths (error_log, access_log, root etc). At configuration time, paths are relative to nginx.conf.

Steps to reproduce

mkdir /tmp/testnginx
cd /tmp/testnginx
devbox init
devbox add nginx
devbox services up -b
tail -1 .devbox/virtenv/nginx/error.log
devbox services down

nginx is failing with:

2026/07/08 23:15:04 [emerg] 1582584#1582584: open() "/tmp/testnginx/devbox.d/nginx/mime.types" failed (2: No such file or directory) in /tmp/testnginx/devbox.d/nginx/nginx.conf:6

Command

services

devbox.json

Devbox version

0.17.5

Nix version

nix (Nix) 2.34.6

What system does this bug occur on?

Linux (x86-64)

Debug logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageIssue needs triage

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions