# Help - Layer7 wrong status, code: 400, info: "Bad Request"

**URL:** https://discourse.haproxy.org/t/help-layer7-wrong-status-code-400-info-bad-request/8464
**Category:** Help!
**Created:** [March 7, 2023, 7:01am UTC](https://discourse.haproxy.org/t/help-layer7-wrong-status-code-400-info-bad-request/8464 "2023-03-07T07:01:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Dulux-Oz](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/dulux-oz/32/1727_2.png) [@Dulux-Oz](https://discourse.haproxy.org/u/Dulux-Oz)
#### Post date: [March 7, 2023, 7:01am UTC](https://discourse.haproxy.org/t/help-layer7-wrong-status-code-400-info-bad-request/8464/1 "2023-03-07T07:01:20Z")

</div>

Hi All,

I’m having an issue with a new Backend (see the Subject). I’ve looked at other, similar posts here & elsewhere and I don’t think (ie can’t see if) they’re relevant to my issue. The HAProxy server is working for a number of other, existing Backends (one example included below) but not for our new Backend.

For the record we tried including the line `default-server ssl check verify none` and got an error with the reason: `Layer7 wrong status, code: 301, info: "Moved Permanently"`

Any help is greatly appreciated - thanks in advance

Here is the new Backend and one of the existing, working Backends:

```auto
backend ceph_dashboard
# Working Backend
    balance roundrobin
    option httpchk GET /
    http-check expect status 200
    server ceph01 ceph01.example.local:8080 check
    server ceph02 ceph02.example.local:8080 check
    server ceph03 ceph03.example.local:8080 check

backend ipa_dashboard
# Non-Working Backend
    balance roundrobin
    option httpchk GET /
    http-check expect status 200
    server ipa01 ipa01.example.local:443 check
    server ipa02 ipa02.example.local:443 check

```

---

<div class="post-metadata">

### Author: ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)
#### Post date: [March 7, 2023, 8:35am UTC](https://discourse.haproxy.org/t/help-layer7-wrong-status-code-400-info-bad-request/8464/2 "2023-03-07T08:35:34Z")

</div>

Your backend server responds with a 301 redirect.

Either consider 301 an expected response (`http-check expect status 301`), or modify the request so that the backend returns 200 (where does the backend redirect to → use that URI in the health check).

---

<div class="post-metadata">

### Author: ![Dulux-Oz](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/dulux-oz/32/1727_2.png) [@Dulux-Oz](https://discourse.haproxy.org/u/Dulux-Oz)
#### Post date: [March 7, 2023, 9:21am UTC](https://discourse.haproxy.org/t/help-layer7-wrong-status-code-400-info-bad-request/8464/3 "2023-03-07T09:21:21Z")

</div>

Thanks @lukastribus, that worked - I don’t know why I didn’t think to change the expected response - doh!

Cheers
