https://github.com/docksal/service-nginx
Nginx service images for Docksal
https://github.com/docksal/service-nginx
Last synced: 4 months ago
JSON representation
Nginx service images for Docksal
- Host: GitHub
- URL: https://github.com/docksal/service-nginx
- Owner: docksal
- License: mit
- Created: 2019-02-04T18:13:04.000Z (over 7 years ago)
- Default Branch: develop
- Last Pushed: 2023-11-15T20:24:27.000Z (over 2 years ago)
- Last Synced: 2025-10-29T18:39:11.838Z (8 months ago)
- Language: Shell
- Homepage: https://docksal.io
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nginx Docker images for Docksal
Nginx images based on the official Nginx images from Docker Hun (alpine flavor) with extra features.
This image(s) is part of the [Docksal](http://docksal.io) image library.
## Versions
- docksal/nginx:1.20
- docksal/nginx:1.21
## Extra features
- SSL enabled (self-signed cert)
- HTTP Basic Authentication
- Configuration presets (`html`, `php`, `drupal`, `wordpress`)
- User configuration overrides
## Document root
Nginx server `root` can be set via `NGINX_SERVER_ROOT` environment variable (defaults to `/var/www/docroot`).
## FastCGI server endpoint
These images are set up to work with a FastCGI server and will not start without one.
The FastCGI endpoint can be set via `NGINX_FCGI_HOST_PORT` environment variable (defaults to `php-fpm:9000`).
## HTTP Basic Authentication
Use `NGINX_BASIC_AUTH_USER` and `NGINX_BASIC_AUTH_PASS` environment variables to set username and password.
Example with Docker Compose
```yaml
...
environment:
- NGINX_BASIC_AUTH_USER=user
- NGINX_BASIC_AUTH_PASS=password
...
```
## Configuration presets
Configuration presets can be set using the `NGINX_VHOST_PRESET` environment variable (defaults to `html`).
Available options:
- `NGINX_VHOST_PRESET=html` - basic HTML site
- `NGINX_VHOST_PRESET=php` - generic PHP application
- `NGINX_VHOST_PRESET=drupal` - Drupal
- `NGINX_VHOST_PRESET=wordpress` - WordPress
## Configuration overrides
Configuration overrides can be added to a Docksal project codebase.
Use `.docksal/etc/nginx/vhost-overrides.conf` to override the default virtual host configuration, e.g.:
```
index index2.html;
```
Use `.docksal/etc/nginx/vhosts.conf` to define additional virtual hosts, e.g.:
```
server
{
listen 80;
server_name test3.docksal.site;
root /var/www/docroot;
index index3.html;
}
```