Skip to content

Commit 9289b0d

Browse files
authored
[Docs] Clarify how NGINX Plugin works in docs (#1653)
## Summary * Docs now describe how the nginx.template and nginx.conf files interact * Added comments to nginx.conf + nginx.template so users know they have to modify nginx.template * Updated example ## How was it tested? Build devbox locally, then made sure the nginx example works
1 parent e083b88 commit 9289b0d

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

docs/app/docs/devbox_examples/servers/nginx.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,13 @@ Use `devbox services start|stop nginx` to start and stop the NGINX service in th
3131
The following helper files will be created in your project directory:
3232

3333
* devbox.d/nginx/nginx.conf
34+
* devbox.d/nginx/nginx.template
3435
* devbox.d/nginx/fastcgi.conf
3536
* devbox.d/web/index.html
3637

37-
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`
38+
Devbox uses [envsubst](https://www.gnu.org/software/gettext/manual/html_node/envsubst-Invocation.html) to generate `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.
39+
40+
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`
3841

3942
### Environment Variables
4043
```bash

plugins/nginx/nginx.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The nginx.conf in this folder is automatically generated from nginx.template
2+
# To modify your NGINX config, edit the nginx.template file
3+
14
events {}
25
http{
36
server {

plugins/nginx/nginx.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The nginx.conf in this folder is automatically generated from nginx.template
2+
# To modify your NGINX config, edit the nginx.template file
3+
14
events {}
25
http{
36
server {

0 commit comments

Comments
 (0)