This fixes #1696
Configuration syntax is based on the suggestion by @nicolas-grekas here
Love to hear your thoughts, although I'm not an expert in this area.