Product

Product Features How to Compare Docs Screenshots Why

Start here

Getting started Download Guides Frequently asked questions

More

Security Support Roadmap About

Maps and lookups

4 answers

Lookup tables, blocklists and values you use elsewhere.

Looking for something specific

The searchable index covers all 326 answers at once and filters as you type.

112 Make a lookup table
  1. Maps, Add one.
  2. Choose what it reads, such as the browser type or the requested host.
  3. Name the variable it sets. You invent this name and then use it elsewhere.
  4. Add the rules, most specific first. The first match wins.
  5. Say what to use when nothing matches.

A plain word matches exactly. A squiggle in front makes it a pattern, and a squiggle and a star makes the pattern ignore capital letters.

maplookupvariablekeyval
113 Build a blocklist I can update from a script

Make a map keyed on the client address, set a variable, and use it on the sites you want protected. Then push updates through the JSON API rather than editing by hand.

Each update means a config render and a graceful reload, so this suits a list you change a few times an hour rather than thousands of times a minute.

blocklistAPIdynamicscript
114 Why does my map value get refused?

The variable a map sets is checked before it is saved. A name nginx does not recognize would stop nginx starting on every server at once, so it is refused at the point of typing instead.

refusedinvalid variablevalidation
204 Use one lookup table across several sites

That is what maps are for. Make it once under Maps, and every site can read the variable it sets. A blocklist, a redirect table, a country to language table, all in one place.

The alternative is the same list pasted into six sites, five of which are out of date by Christmas.

These are hostnames on the map dialog matters if the values are domain names, because it makes the matching work the way names work, with the wildcard on the left.

shared maplookupreuseblocklistone place

Two fresh servers is all it takes

Ubuntu 22.04 or newer, root access, and about twenty minutes. The installer does the rest and it is safe to run twice.