Collection of scripts to automate the creation and management of proxies for an Nginx proxy server.
This repository includes three primary scripts:
- mkproxy: Creates an Nginx proxy for
subdomain.mydomain.com
on a specified port. - rmproxy: Removes proxy files created by
mkproxy
and creates an inactive backup in/etc/nginx/sites-available/backup/
. - lsproxy: Lists active proxies created by
mkproxy
.
- The scripts require administrative privileges to run.
- Ensure
DOMAIN_NAME
andNGINX_PATH
variables are updated according to your setup. - Place the scripts in your binary directory (e.g.
/usr/local/bin/
) and make them executable:sudo chmod +x <script>
Creates an Nginx proxy.
sudo mkproxy <subdomain> <port>
Removes a specified proxy and creates a backup.
sudo rmproxy <subdomain>
Lists all active proxies created by the script.
sudo lsproxy
To generate certificates, use the certbot
package:
Certbot GitHub