right config: >> rewrite ^ https://www.mydomain.com$request_uri? permanent; wrong config: > rewrite ^ https://www.mydomain.com$request_url permanent; -- Best regards, Gena