Haproxy - wordpress problem in SSL

A problem in WordPress SSL HAPROXY


Have a problem to put your SSL in your WordPress using HAPROXY as a reverse proxy?


To resolve this is simple

Add in  wp-config.php

define('FORCE_SSL_ADMIN', true);
define('FORCE_SSL_LOGIN', true);
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
  $_SERVER['HTTPS']='on';


Add this in your haproxy.


frontend webfront
  mode http
  bind 0.0.0.0:443 ssl crt /etc/haproxy/certs.d
  reqadd X-Forwarded-Proto:\ https
  ...
  ...





Make sure to use option http-server-close as well or the reqadd setting might not work as expected.

Popular posts from this blog

Remote Server returned '550 5.2.3 RESOLVER.RST.RecipSizeLimit; message too large for this recipient'

Haproxy error inconsistencies between private key and certificate loaded from PEM file

Porque a centralização de arquivos?