WordPress behind HAProxy on OPNsense

Add this code to the backend pool. Services -> HAProxy -> Settings -> Virtual Service -> Backend Pools -> your backend pool -> Edit -> Advanced Mode -> Option pass-through:

#force SSL redirect redirect scheme https if !{ ssl_fc } # close open connections option http-server-close # add X-FORWARDED-FOR option forwardfor # add X-Forwarded-Proto http-request set-header X-Forwarded-Proto https if { ssl_fc }