fixes part of #1939
changes were consulted with @wvffle, but will probably need further fixes after merge
it will be easier to fix nginx problems tho as every config will be equal now ;)