Strange behaviour of Laravel application behind HAPROXY load balancer

36 views Asked by At

All forms in Laravel behind a Haproxy load balancer are prepended by an http URL in the form action.

SSL port is forwarded to HTTP port(80) on each app server in haproxy. Everything else works fine.

However, the form template generated by

<form action="{{ route('your.route.name') }}" method="post">
    <!-- Your form fields and submit button go here -->
</form>

prepends http://web_url instead of https://web_url. We have provided https://web_url in the .env file on all servers.

So when checking the source we see

<form
              class="form-horizontal mt-3"
              id="loginform"
              action="http://web_url/login"
              method="POST"
            >

What could be the issue.

Everything else works absolutely fine. Why is the APP_URL not being picked up, and the http:// is prepended instead of https://

0

There are 0 answers