Access wp-admin page behind haproxy
-
Hi,
I installed haproxy front-end in front of my nginx server hosting wordpress and I can’t access the administration page. HAProxy is in charge of SSL.
I added these lines in the file wp-config.phpdefine('FORCE_SSL_ADMIN', true); define('FORCE_SSL_LOGIN', true); if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') { $_SERVER['HTTPS']='on'; }
Here is my HAProxy configuration
frontend www-http bind *:80 option forwardfor option http-server-close reqadd X-Forwarded-Proto:\ http acl host_mysite hdr(host) -i mysite acl path-content-admin path /wp-admin redirect scheme https if host_mysite path-content-admin use_backend mysite-backend if host_mysite frontend www-https bind *:443 ssl crt /etc/haproxy/certs/mysite.pem option forwardfor option http-server-close http-request set-header X-SSL %[ssl_fc] reqadd X-Forwarded-Proto:\ https acl host_mysite hdr(host) -i mysite use_backend mysite-backend if host_mysite backend mysite-backend redirect scheme https code 301 if !{ ssl_fc } server mysite xxx.xxx.xxx.xxx:80 send-proxy check
Someone can help me, please
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Access wp-admin page behind haproxy’ is closed to new replies.