Nginx refusing connection from mailgate when using ssl

Hi, when I try to use the mailgate to create tickets, nginx refuses
the connection and returns a 400 error. Upon further inspection of the
nginx error log I found this error message:

[info] 37079#0: *17 client sent plain HTTP request to HTTPS port while
reading client request headers

I execute the mailgate with the command
|/usr/local/bin/rt-mailgate --queue general --action correspond
–no-verify-ssl --url
|/usr/local/bin/rt-mailgate --queue general --action correspond
–no-verify-ssl --url

I have no problem connecting to the web interface and I have also set
the parameter
fastcgi_param HTTPS on;
in nginx.

When I tried RT over plain http I had no problem getting the mailgate to work.

I’m using RT 4.2.5 and have used the README and official documentation
for setting up my RT instance.

Unfortunately my attempts to find a solution to the problem in the
wiki and in previous mails in the mailing lists have failed and if
someone has the time to help me it would be much appreciated!

Best regards,
Erik Jonsson-Glans