Infinite loop behind SSL proxy on non-standard port

Changing

proxy_set_header Host $host;

to

proxy_set_header Host $http_host;

fixed the issue.

(source)

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)