Sign inSign up

jonkofee/nginx

By jonkofee

•Updated almost 7 years ago

Support environment variables in the config file

Image
1

288

jonkofee/nginx repository overview

nginx latest

Wrapper for nginx official image⁠

⁠Features

  • Default server responses 404 code
  • Using environment variables in the config file
  • Enabled GZIP
  • Default charset UTF-8
  • Off server tokens (nginx version in response header)
  • Keepalive timeout 30 sec
  • Enabled sendfile

⁠Exampe use ENV var in config file

⁠docker-compose.yml
version: '3'
services:
  web:
  image: jonkofee/nginx
  working_dir: /code
  ports:
    - ${NGINX_SERVER_PORT}:80
  volumes:
    - ./:/code
    - ./docker/nginx/conf:/etc/nginx/conf.d
  environment:
    - DOMAIN=test.local
    - PORT=80 
⁠host.conf
server {
  server_name api.${DOMAIN};
  listen ${POST}

  location / {
    root /code;

    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass php:9000;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root/index.php;
    fastcgi_param PATH_INFO $fastcgi_path_info;
  }
}

Tag summary

Content type

Image

Digest

Size

10.5 MB

Last updated

almost 7 years ago

docker pull jonkofee/nginx