A tool to help purge Nginx cache. It can either run locally with the purge command, or run as a local unix service to allow for purging by Nginx http requests.
## Install
You can install either by downloading the latest binary release, or by building.
## Building
Building should be as simple as running:
```
go build
```
## Running as a service
If you want to run as a service to allow purge requests via http requests, you'll need to create a systemd service file and place it in `/etc/systemd/system/nginx-cache-purge.service`.
```
[Unit]
Description=Nginx Cache Purge
After=network.target
[Service]
User=nginx
Group=nginx
RuntimeDirectory=nginx-cache-purge
PIDFile=/var/run/nginx-cache-purge/service.pid
ExecStart=/usr/local/bin/nginx-cache-purge server
Restart=always
RestartSec=3s
[Install]
WantedBy=multi-user.target
```
You can then run the following to start the service:
```
systemctl daemon-reload
systemctl start nginx-cache-purge.service
```
## Nginx config
If you want to purge via Nginx http requests, you'll need to add configuration to your Nginx config file.