Sign inSign up

identt/configurable-nginx

By identt

•Updated over 7 years ago

Nginx image based on nginx:1.12.2-perl with added possibility to configure via environment variables

Image
0

10K+

identt/configurable-nginx repository overview

⁠How to use
  1. Create new file: /etc/nginx/nginx.env. This is used to define the variables you want to use in your configs, and also their default values. Example:
SERVER_NAME=example.org
PORT=80
  1. Use the defined variables in your configuration files (nginx.conf, proxy.conf and/or sites-enabled), marking them with '%' at the beginning and end. Example:
server {
    listen %PORT%;
    server_name %SERVER_NAME%;
}
  1. To override the defaults, set environment variables in your container just like you'd normally do. Example with docker-compose:
version: "2"
services:
  nginx:
    build: .
    environment:
      - PORT=443

Tag summary

Content type

Image

Digest

Size

72.1 MB

Last updated

over 7 years ago

docker pull identt/configurable-nginx