T/refactor nginx conf generation

Used a definition, because I can.