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.comon a specified port. - rmproxy: Removes proxy files created by
mkproxyand 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_NAMEandNGINX_PATHvariables 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 lsproxyTo generate certificates, use the certbot package:
Certbot GitHub