#1
Hi all,
I am hosting my own website and it is behind nginx proxy manager and using Let's Encrypt. The custom routing was not working and some of the Manage Articles features were acting weird, like uploading pictures was broken, and some other stuff.
After a lot of bug tracking and testing new things inside the engine folder, I narrowed it down to the current_url function inside the url_helper. The $_SERVER['HTTPS'] was not set to on so it was returning the wrong url. Adding $_SERVER['HTTPS'] = 'on'; to config.php seems to have fixed most of my problems, if not all.
Does anybody see any problems doing this?? What would be other solutions to this problem??
Thank you,
John
#2
Hi John,

Interesting find. I don't see anything wrong with your solution, but for some other ideas, check out this Serverfault answer:

https://serverfault.com/questions/875245/nginx-how-to-enable-ssl-for-php-when-behind-a-reverse-proxy

From a PHP standpoint, they discuss looking at $_SERVER['HTTP_X_FORWARDED_PROTO'], which should have a value of 'https' if indeed the traffic originated over HTTPS.

Another option discussed is to configure Nginx to pass that information along to PHP/whatever is next in the chain behind the proxy.

Hope this helps,

A.K.