A dirty easy to manage redirect site (I use it for my shortlinks)
10K+
An easy to use redirection script. What for? ehh... to have nice urls :D
/refresh endpoint for the script to load the URLs into redis/refresh endpoint&wait=10. What this does is just... well, waiting 10 seconds before grabbing the file from github :)&domain=gmc.uy, so that when my repository gets updated, only my script is executedThe setup is pretty straightforward, this is my docker-compose.yml
version: '2'
services:
simple-redirect:
image: 'g3rv4/simple-redirect'
restart: always
environment:
- REDIS_HOST=localhost
- REDIS_DB=1
- CONFIG_FILE=/var/config/config.json
volumes:
- '/path/to/config:/var/config'
ports:
- '8000:8000'
Once you have that running, it exposes the app in the port 8000. You may probably want to put an nginx between the app server and internet. You should mount /var/config containing a configuration file... here's mine for reference
{
"key": "thisIsACrazySecretNobodyKnows",
"domains": {
"gmc.uy": {
"urls": "https://raw.githubusercontent.com/g3rv4/redirections/master/urls.json",
"afterRefresh": "/var/config/clear-cache.sh -zone myZoneId"
},
"dv.uy": {
"urls": "https://raw.githubusercontent.com/d4tagirl/redirections/master/urls.yml",
"afterRefresh": "/var/config/clear-cache.sh -zone anotherZoneId"
}
}
}
and if you're running scripts (as I am) they should also go in the config folder. Feel free to check out my blog post about it :)
Content type
Image
Digest
Size
87.7 MB
Last updated
over 9 years ago
docker pull g3rv4/simple-redirect