diff --git a/nginx.conf b/nginx.conf index 099f6ac5..68123a76 100644 --- a/nginx.conf +++ b/nginx.conf @@ -157,23 +157,26 @@ location /INSTANCE { # -- https://adsb.lol/EHAM -> https://adsb.lol/?airport=EHAM --- if 4 a-z # -- https://adsb.lol/AMS -> https://adsb.lol/?airport=AMS --- if 3 a-z # -- https://adsb.lol/lat,lon -> https://adsb.lol/?lat=lat&lon=lon --- if , is found - # -- https://adsb.lol/KLM94G -> https://adsb.lol/?callsign=KLM94G --- if above not matched + # -- https://adsb.lol/KLM94G -> https://adsb.lol/?reg=KLM94G --- if above not matched # regex woot woot! # offload to @fallback on error_page 404 = @fallback; location ~* "^/(?[a-zA-Z]{3,4})$" { + # /AMS, /EHAM, etc. content_by_lua_block { ngx.redirect("/?airport=" .. ngx.var.airport, ngx.HTTP_MOVED_TEMPORARILY) } } location ~* "^/(?[0-9a-fA-F]{6}(?:,[0-9a-fA-F]{6})*)$" { + # /000000, /ffffff, etc content_by_lua_block { ngx.redirect("/?icao=" .. ngx.var.icao, ngx.HTTP_MOVED_TEMPORARILY) } } location ~* "^/(?[0-9.-]+),(?[0-9.-]+)$" { + # 0,0 , 1,1 , -180,-180, etc. content_by_lua_block { ngx.log(ngx.ERR, "lat: " .. ngx.var.lat .. " lon: " .. ngx.var.lon) } @@ -187,7 +190,8 @@ location /INSTANCE { } } - location ~* "^/(?[a-zA-Z0-9-]{5,6}(?:,[a-zA-Z0-9-]{5,6})*)$" { + # registration + location ~* "^/(?[a-zA-Z0-9-]{5,12}(?:,[a-zA-Z0-9-]{5,12})*)$" { content_by_lua_block { ngx.var.reg = ngx.re.gsub(ngx.var.reg, "-", "") ngx.redirect("/?reg=" .. ngx.var.reg, ngx.HTTP_MOVED_TEMPORARILY)