examples/servers/nginx/README.md
NGINX can be automatically configured by Devbox via the built-in NGINX Plugin. This plugin will activate automatically when you install NGINX using devbox add nginx
Run devbox add nginx, or add the following to your devbox.json
"packages": [
"nginx@latest"
]
This will install the latest version of NGINX. You can find other installable versions of NGINX by running devbox search nginx. You can also view the available versions on Nixhub
Use devbox services start|stop nginx to start and stop the NGINX service in the background
The following helper files will be created in your project directory:
Note that by default, NGINX is configured with ./devbox.d/web as the root directory. To change this, you should modify ./devbox.d/nginx/nginx.conf
NGINX_CONFDIR=devbox.d/nginx/nginx.conf
NGINX_PATH_PREFIX=.devbox/virtenv/nginx
NGINX_TMPDIR=.devbox/virtenv/nginx/temp
You can easily configure NGINX by modifying these env variables in your shell's init_hook
To customize:
You can also customize the nginx.conf and fastcgi.conf stored in devbox.d/nginx