Skip to content

A wizard for adding new URLs to Nginx πŸ§™β€β™‚οΈ

License

Notifications You must be signed in to change notification settings

julianorchard/nginx-wizard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Nginx Wizard πŸ§™β€β™‚οΈ

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.

Dependencies

Required:

  • Python 3
  • Nginx

Optional:

  • Certbot to create certificates for the URLs set up by this script

Debian/Ubuntu

If using APT, the following command will install the right dependencies:

sudo apt install nginx certbot python3-certbot-nginx

Installation

Clone the repository to a location you like (ideally somewhere in your PATH):

git clone https://github.com/julianorchard/nginx-wizard

Usage

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'!

Contributing

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!

License

The contents of this repository is under the MIT License. Please see the license file for more information.

About

A wizard for adding new URLs to Nginx πŸ§™β€β™‚οΈ

Topics

Resources

License

Stars

Watchers

Forks