Initialization wizzard fails with *504 Gateway Time-out*

Hello! Please, advice how can I finish installation.

I want to set Xwiki on Debian 9 with secure connection, and use these steps.

  1. Install Xwiki from APT packages and set -Xmx1024m for Java memory.
  2. Install nginx
  3. Install certbot
  4. Put config for Xwiki HTTPS to nginx.

And after I open I get to Distribution wizard initialization, which finish with error 504.

XWiki is initializing (91%)…

504 Gateway Time-out