https://github.com/bfren/docker-nginx
Docker Nginx image.
https://github.com/bfren/docker-nginx
docker docker-nginx nginx
Last synced: 5 months ago
JSON representation
Docker Nginx image.
- Host: GitHub
- URL: https://github.com/bfren/docker-nginx
- Owner: bfren
- License: mit
- Created: 2020-11-07T08:56:00.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-10T06:57:49.000Z (8 months ago)
- Last Synced: 2024-10-12T02:51:50.893Z (8 months ago)
- Topics: docker, docker-nginx, nginx
- Language: Nushell
- Homepage:
- Size: 329 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Docker Nginx
   
[Docker Repository](https://hub.docker.com/r/bfren/nginx) - [bfren ecosystem](https://github.com/bfren/docker)
A simple Nginx base image - no SSL support etc, designed to be used behind a proxy server.
Files are served from /www/public (which can be overridden using BF_NGINX_PUBLIC_OVERRIDE).
## Contents
* [Ports](#ports)
* [Volumes](#volumes)
* [Environment Variables](#environment-variables)
* [Helper Functions](#helper-functions)
* [Nginx Configuration Helpers](#nginx-configuration-helpers)
* [Licence / Copyright](#licence)## Ports
* 80
## Volumes
| Volume | Purpose |
| ------ | --------------------------------------------------------------------------------------------------------- |
| `/www` | Files in this directory are served by Nginx (if not mapped, a 'Welcome to Nginx' message will be served). |## Environment Variables
| Variable | Values | Description | Default |
| ----------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------ | ------------------ |
| `BF_NGINX_FORWARD_ACCESS_LOG` | 0 or 1 | If 1, the access log will be forwarded to Docker's stdout. | 0 |
| `BF_NGINX_HEALTHCHECK_URI` | URI | The URI to load during the healthcheck. | http://localhost |
| `BF_NGINX_IGNORE_FAVICON` | 0 or 1 | If 1, a helper configuration file will contain a directive to return 204 (No Content) when a favicon is requested. | 1 |
| `BF_NGINX_PUBLIC_OVERRIDE` | string | If set, it will be used as the nginx root directory (which by default is /www). | *blank* |## Helper Functions
| Function | Arguments | Description | Usage |
| -------------- | --------- | ---------------------------------------------------------------------- | ---------------------------------------- |
| `healthcheck` | *None* | Loads BF_NGINX_HEALTHCHECK_URI to check everything is working. | `docker exec <> healthcheck` |
| `nginx-reload` | *None* | Tests Nginx configuration and if successful, reloads the Nginx server. | `docker exec <> nginx-reload` |## Nginx Configuration Helpers
The image contains a handful of useful Nginx configuration 'helper' files, which you can find in `/overlay/etc/nginx/helpers`. They all begin with the prefix 'nginx':
| Helper | Description |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `-base.conf` | Basic configuration, sets listen port, document root, and adds the [GNU Terry Pratchett](http://www.gnuterrypratchett.com/) header. |
| `-ignore-favicon.conf` | Returns 204 for favicon.ico requests that do not exist, and stops it being added to the error log. |
| `-error-pages.conf` | Include if you want to use Nginx's default error pages. |
| `-static-files.conf` | Sets useful headers, cache, and expiration values for serving static files. |
| `-uploads.conf` | Sets `client_max_body_size` to 0 - so there is no limit on file upload size. |## Licence
> [MIT](https://mit.bfren.dev/2020)
## Copyright
> Copyright (c) 2020-2024 [bfren](https://bfren.dev) (unless otherwise stated)