Fixes for correct work with nginx