Posted by & filed under blog, wordpress, wordpress hosting, zippykid.

We ran into this issue for a client today, where we kept running into an infinite loop when the visitor went to a page that required SSL. After a lot of tracing, it turned out that the is_ssl() function in wp-includes was passing a false, even though the site was using SSL. Turned out we ran into a perfect storm of mis/non-standard configuration. The internally bound port for the site was not 443, but something else, after a few hours of inappropriately cursing the function, I decided to take a break and tackle the problem again. Discussed the issue on the #wordpress channel on irc, and fortunately Sivel was there, who pointed out my fallacy, I just needed to pass the HTTPS on; parameter via the nginx configuration.

So to avoid others pulling their hair out like I did.. triple check if you have the line

fastcgi_params HTTPS on;

Make sure it’s there in your server_block for the secure virtual host, and you’ll be good to go. It’s kinda embarrassing to admit that I didn’t have this.. but sometimes this level of public self-shaming is necessary..


One thought on “Telling WordPress or PHP that you’re using HTTPS when using Nginx and PHP-FPM

  1. Pothi says:

    Thanks for sharing the fix. I had this problem, but never tried to fix it. Never thought that it was fastcgi_params that needed to be configured to accept SSL connections. Thanks for sharing the background info shamelessly that you could have avoided, if needed.

Leave a Reply