Adding NGINX to your Shell
Rundevbox add nginx, or add the following to your devbox.json
devbox search nginx. You can also view the available versions on
Nixhub
NGINX Plugin Details
Services
- nginx
devbox services start|stop nginx to start and stop the NGINX service in the background
Helper Files
The following helper files will be created in your project directory:- devbox.d/nginx/nginx.conf
- devbox.d/nginx/nginx.template
- devbox.d/nginx/fastcgi.conf
- devbox.d/web/index.html
nginx.conf from the nginx.template file every time Devbox starts a shell, service, or
script. This allows you to create an NGINX config using environment variables by modifying
nginx.template. To edit your NGINX configuration, you should modify the nginx.template file.
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.template
Environment Variables
Notes
You can easily configure NGINX by modifying these env variables in your shell’sinit_hook
To customize:
- Use $NGINX_CONFDIR to change the configuration directory
- Use $NGINX_LOGDIR to change the log directory
- Use $NGINX_PIDDIR to change the pid directory
- Use $NGINX_RUNDIR to change the run directory
- Use $NGINX_SITESDIR to change the sites directory
- Use NGINX_USER to change the user
- Use $NGINX_GROUP to customize.
nginx.conf and fastcgi.conf stored in devbox.d/nginx
Disabling the NGINX Plugin
You can disable the NGINX plugin by runningdevbox add nginx --disable-plugin, or by setting the
disable_plugin field in your devbox.json: