Skip to content

Commit

Permalink
Add redirection for the planet and the hub websites
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix committed Nov 5, 2024
1 parent a15c19b commit e4e8739
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dockerize/sites-enabled/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ if [ $# -eq 1 ]; then
echo "Run in prod mode"
CONF_FILE=prod.conf
ln -s /etc/nginx/sites-available/$CONF_FILE /etc/nginx/conf.d/$CONF_FILE
ln -s /etc/nginx/sites-available/redirections.conf /etc/nginx/redirections.conf
exec nginx -g "daemon off;"
;;
# Production SSL mode, run using uwsgi
[Pp][Rr][Oo][Dd][-][Ss][Ss][Ll])
echo "Run in prod SSL mode"
CONF_FILE=prod-ssl.conf
ln -s /etc/nginx/sites-available/$CONF_FILE /etc/nginx/conf.d/$CONF_FILE
ln -s /etc/nginx/sites-available/redirections.conf /etc/nginx/redirections.conf
exec nginx -g "daemon off;"
;;
esac
Expand Down
6 changes: 6 additions & 0 deletions dockerize/sites-enabled/prod-ssl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ server {
if ($http_user_agent ~* (360Spider|80legs.com|Abonti|AcoonBot|Acunetix|adbeat_bot|AddThis.com|adidxbot|ADmantX|AhrefsBot|AngloINFO|Antelope|Applebot|BaiduSpider|BeetleBot|billigerbot|binlar|bitlybot|BlackWidow|BLP_bbot|BoardReader|Bolt\ 0|BOT\ for\ JCE|Bot\ mailto\:craftbot@yahoo\.com|casper|CazoodleBot|CCBot|checkprivacy|ChinaClaw|chromeframe|Clerkbot|Cliqzbot|clshttp|CommonCrawler|comodo|crawler4j|Crawlera|CRAZYWEBCRAWLER|Curious|Custo|CWS_proxy|Default\ Browser\ 0|diavol|DigExt|Digincore|DIIbot|discobot|DISCo|DoCoMo|DotBot|Download\ Demon|DTS.Agent|EasouSpider|eCatch|ecxi|EirGrabber|Elmer|EmailCollector|EmailSiphon|EmailWolf|Exabot|ExaleadCloudView|ExpertSearchSpider|ExpertSearch|Express\ WebPictures|ExtractorPro|extract|EyeNetIE|Ezooms|F2S|FastSeek|feedfinder|FeedlyBot|FHscan|finbot|Flamingo_SearchEngine|FlappyBot|FlashGet|flicky|Flipboard|g00g1e|Genieo|genieo|GetRight|GetWeb\!|GigablastOpenSource|GozaikBot|Go\!Zilla|Go\-Ahead\-Got\-It|GrabNet|grab|Grafula|GrapeshotCrawler|GTB5|GT\:\:WWW|Guzzle|harvest|HMView|HomePageBot|HTTP\:\:Lite|HubSpot|icarus6|IDBot|id\-search|IlseBot|Image\ Stripper|Image\ Sucker|Indigonet|Indy\ Library|integromedb|InterGET|InternetSeer\.com|Internet\ Ninja|IRLbot|ISC\ Systems\ iRc\ Search\ 2\.1|jakarta|JetCar|JobdiggerSpider|JOC\ Web\ Spider|Jooblebot|kanagawa|KINGSpider|kmccrew|larbin|LeechFTP|libwww|Lingewoud|LinkChecker|linkdexbot|LinksCrawler|LinksManager\.com_bot|linkwalker|LinqiaRSSBot|LivelapBot|ltx71|LubbersBot|lwp\-trivial|Mail.RU_Bot|masscan|Mass\ Downloader|maverick|Maxthon$|Mediatoolkitbot|MegaIndex|MegaIndex|megaindex|MFC_Tear_Sample|Microsoft\ URL\ Control|microsoft\.url|MIDown\ tool|miner|Missigua\ Locator|Mister\ PiX|mj12bot|Mozilla.*Indy|Mozilla.*NEWT|MSFrontPage|msnbot|Navroad|NearSite|NetAnts|netEstate|NetSpider|NetZIP|Net\ Vampire|NextGenSearchBot|nutch|Octopus|Offline\ Explorer|Offline\ Navigator|OpenindexSpider|OpenWebSpider|OrangeBot|Owlin|PageGrabber|PagesInventory|panopta|panscient\.com|Papa\ Foto|pavuk|pcBrowser|PECL\:\:HTTP|PeoplePal|Photon|PHPCrawl|planetwork|PleaseCrawl|PNAMAIN.EXE|PodcastPartyBot|prijsbest|proximic|psbot|purebot|pycurl|QuerySeekerSpider|R6_CommentReader|R6_FeedFetcher|RealDownload|ReGet|Riddler|Rippers\ 0|rogerbot|RSSingBot|rv\:1.9.1|RyzeCrawler|SafeSearch|SBIder|Screaming|search.goo.ne.jp|SearchmetricsBot|search_robot|SemrushBot|Semrush|SentiBot|SEOkicks|SeznamBot|ShowyouBot|SightupBot|SISTRIX|sitecheck\.internetseer\.com|siteexplorer.info|SiteSnagger|skygrid|Slurp|SmartDownload|Snoopy|Sogou|Sosospider|spaumbot|Steeler|sucker|SuperBot|Superfeedr|SuperHTTP|SurdotlyBot|Surfbot|tAkeOut|Teleport\ Pro|TinEye-bot|TinEye|Toata\ dragostea\ mea\ pentru\ diavola|Toplistbot|trendictionbot|TurnitinBot|turnit|URI\:\:Fetch|Vagabondo|Vagabondo|vikspider|VoidEYE|VoilaBot|WBSearchBot|webalta|WebAuto|WebBandit|WebCollage|WebCopier|WebFetch|WebGo\ IS|WebLeacher|WebReaper|WebSauger|Website\ eXtractor|Website\ Quester|WebStripper|WebWhacker|WebZIP|Web\ Image\ Collector|Web\ Sucker|Wells\ Search\ II|WEP\ Search|WeSEE|Widow|WinInet|woobot|woopingbot|worldwebheritage.org|Wotbox|WPScan|WWWOFFLE|WWW\-Mechanize|Xaldon\ WebSpider|XoviBot|yacybot|Yahoo|YandexBot|Yandex|YisouSpider|zermelo|Zeus|zh-CN|ZmEu|ZumBot|ZyBorg) ) {
return 403;
}

# Redirect planet and hub resources to the new location
include redirections.conf;
}

location /metabase/ {
Expand Down Expand Up @@ -220,6 +223,9 @@ server {
return 403;
}

# Redirect planet and hub resources to the new location
include redirections.conf;

}


Expand Down
3 changes: 3 additions & 0 deletions dockerize/sites-enabled/prod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ server {
return 403;
}

# Redirect planet and hub resources to the new location
include redirections.conf;

}


Expand Down
6 changes: 6 additions & 0 deletions dockerize/sites-enabled/redirections.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
rewrite ^/planet$ https://planet.qgis.org permanent;
rewrite ^/styles(.*)$ https://hub.qgis.org/styles$1 permanent;
rewrite ^/geopackages(.*)$ https://hub.qgis.org/geopackages$1 permanent;
rewrite ^/models(.*)$ https://hub.qgis.org/models$1 permanent;
rewrite ^/wavefronts(.*)$ https://hub.qgis.org/wavefronts$1 permanent;
rewrite ^/layerdefinitions(.*)$ https://hub.qgis.org/layerdefinitions$1 permanent;

0 comments on commit e4e8739

Please sign in to comment.