A Python script to configure new URLs on Nginx, via a command line wizard.
The steps and configurations chosen are those I found myself needing the most when adding new URLs.
Tested on Ubuntu 20.04 LTS. Should work on other distributions.
Required:
- Python 3
- Nginx
Optional:
- Certbot to create certificates for the URLs set up by this script
If using APT, the following command will install the right dependencies:
sudo apt install nginx certbot python3-certbot-nginx
Clone the repository to a location you like (ideally somewhere in your PATH):
git clone https://github.com/julianorchard/nginx-wizard
The process this wizard guides you through is pretty simple.
It looks something like this:
$ sudo nginx-wizard/nginx-wizard
Please enter your user account username: exampleuser
Please enter the site URL: test.com
Creating directory at /var/www/test.com...
Creating a shortcut to directory in /home/exampleuser/...
Would you like this setup to use the SSL configuration file? (y/n) n
Moving Nginx template file into position with new details...
Creating link from /sites-available/ to /sites-enabled/...
Don't forget to refresh service with 'service nginx reload'!
If something needs fixing, please submit a pull request or an issue. If there is a configuration you would like to change, it might be best to fork this repository and work on your own changes: the changes you want to implement might be personal preference!
However, if there is a change which you think would be a better default, please contact with me via email or @jdo@mastodon.social!
The contents of this repository is under the MIT License. Please see the license file for more information.