Use envsubst for environment variables in nginx.conf #28

Closed
opened 2022-10-29 18:10:33 +00:00 by emacsen · 2 comments
emacsen commented 2022-10-29 18:10:33 +00:00 (Migrated from gitlab.com)

To allow for fallthrough of environment variables such as AP_SERVER and AP_PORT, in nginx.conf, we must have envsubst, which already comes with alpine-fat, which we are using.

Unfortunately, in order to achieve this, we must make a few changes:

  1. The nginx.conf file must be turned into a template file
  2. envsubst must be called on the template file before execution, which requires
  3. A new entrypoint script must be written which will run envsubst and also set default values to any unset variables, eg setting AP_PORT to `80'.
To allow for fallthrough of environment variables such as `AP_SERVER` and `AP_PORT`, in `nginx.conf`, we must have `envsubst`, which already comes with `alpine-fat`, which we are using. Unfortunately, in order to achieve this, we must make a few changes: 1. The `nginx.conf` file must be turned into a template file 2. `envsubst` must be called on the template file before execution, which requires 3. A new entrypoint script must be written which will run `envsubst` and also set default values to any unset variables, eg setting `AP_PORT` to `80'.
emacsen commented 2022-10-29 18:10:33 +00:00 (Migrated from gitlab.com)

assigned to @emacsen

assigned to @emacsen
emacsen commented 2023-02-15 00:33:08 +00:00 (Migrated from gitlab.com)

This is unnecessary due to other changes.

This is unnecessary due to other changes.
emacsen (Migrated from gitlab.com) closed this issue 2023-02-15 00:33:08 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
babka/activitycolander#28
No description provided.