I have an update form, which updates my database with the given inputs. I use the [Laravel validation](https://laravel.com/docs/5.6/validation) to make an update validator to check if the given e-mail is unique or not (if it's not it should throw me the validation error and reload the update page). 

This is my validator:

```
public function rules()
    {
        $contact_guid = $this->route('contact_guid');
        return  [
            'contact_email' => [
                Rule::unique('contact')->ignore($contact_guid, 'contact_guid'),
            ],
        ];
    }

    public function messages()
    {
        return [
            'contact_email.required' => 'E-mail is required.',
            'contact_email.unique'  => 'This e-mail is already in use.',
        ];
    }

```

The problem appears to be that some contacts give the `502 error` with certain unique emails and other contacts get the 502 error on different unique emails. I've noticed that once I remove `'contact_email.unique' => 'This e-mail is already in use.',` that my application works fine and it doesn't give me the `502 error`.

Edit:

I found that how longer the message is at `'contact_email.unique' => 'This e-mail is already in use.',`, it gives me the 502 bad gateway more often.