URL redirection link manager for Nginx that uses Google Sheets as a front end interface.
Features
- Redirect generation can be handled with confidence by non-technicals
- Sheet provides basic validation of URLs
- Google Sheets provides easy-to-use versioning to protect your data
- Script parsing is FAST
- Error correction protects existing "known good" from faults
- Native nginx redirection; No reliance on databases or dynamic code to parse requests
- Simple codebase to allow for modification
How the Sheet Works:
- Add category, name, URL you want, and what it redirects to
- Spreadsheet will check for basic parsing issues automatically
How the Server Works:
- Run or cron make.sh
- Creates a CSV from Google Docs using wget
- Validates CSV to prevent incorrect configurations
- Creates nginx syntax file of all redirects as redirect.conf
- Generates static HTML file with list of current redirects for indexing (with additional info)
- Restarts Nginx server to activate new links
The Sheet
- Clone the Google Sheet using this template
- Click the blue share button, then "Get Shareable Link"
- Copy the link it provides
- Replace "/edit?usp=sharing" with "/export?format=csv" this is the link needed for make.sh
The Scripts 2. Clone this repo "git clone https://github.com/johnvilsack/sheets-url-redirect.git" 3. Find the @@ notations in make.py and make.sh; inserting your customizations
In the server{} config:
location @redirect {
include path_to_redirect.conf_file;
}
The redirect.conf file will be generated in the same folder you run the script from.
- Run ./make.sh
- Test
- Spend your time on something you enjoy
You can add this to cron for fun and profit.