DevOps · Flashcard

How does the alias directive differ from root when mapping a location to disk?

  • Aalias replaces the matched location part of the URI with the alias path
  • Balias appends the entire request URI to the alias path, exactly like root does
  • Calias serves files only from memory, whereas root reads them from the disk
  • Dalias works only inside regex locations, whereas root works in prefix ones

Why this is the answer

For location /i/ { alias /data/images/; } a request /i/a.png maps to /data/images/a.png, replacing the matched /i/. Appending the whole URI is root's behavior, not alias's; both read from disk; and alias is not restricted to regex locations.

Official docs
Study in Gnoseed →