php - When form validation fails behind CloudFront, user is sent to root rather than back to form -
i have silverstripe website running on 2 servers behind load balancer, behind cloudfront. redis stores session information , have sync task syncs assets required. working fine.
i have form has various required fields. when form filled in correctly works fine , directs person correct place. if user misses field should redirect form. instead redirects them /. if click in browser takes me form , correct fields highlighted missing.
if test on local machine works expected. if fix myself 1 of servers in prod works fine, if switch between 2 servers manually.
i did in travels realise needed define load balancer in _ss_environment.php file:
define('ss_trusted_proxy_ips', 'x.x.x.x/16'); define('ss_trusted_proxy_ip_header', 'x-forwarded-for'); define('ss_trusted_proxy_protocol_header', 'x-forwarded-proto'); i couldn't find trusted_proxy defined in framework added
define('trusted_proxy', '1'); as well.
however form still redirecting / when validation fails.
what going on? there other things i'm missing define lb?
edit
i've removed cloudfront (lb still in place) , it's working expected. i'd prefer put on unsure causing issue. far can tell thing needs forward phpsessid cookie, should there else?
for cloudfront have whitelist several headers. issue believe referer header.
Comments
Post a Comment