# Mock Server 502 Bad Gateway

**URL:** <https://community.postman.com/t/mock-server-502-bad-gateway/30737>\
**Category:** Help Hub\
**Created:** [December 15, 2021, 3:01pm UTC](https://community.postman.com/t/mock-server-502-bad-gateway/30737 "2021-12-15T15:01:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stuart.Doolan](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@Stuart.Doolan](https://community.postman.com/u/Stuart.Doolan)\
**Post date:** [December 15, 2021, 3:01pm UTC](https://community.postman.com/t/mock-server-502-bad-gateway/30737/1 "2021-12-15T15:01:39Z")

</div>

> **Archived topic — some details may be out of date.**  
> Mock servers built from saved collection examples are still supported. Postman now also has **code-based mocks** : JavaScript request handlers plus a `config.yaml`, stored as files in your Git repository, which you can run locally or deploy. Create one in the app, or use the Postman CLI to generate one from an OpenAPI spec, collection or dataset (`postman mock generate`) and run it (`postman mock run`). See [About mocks](https://learning.postman.com/docs/design-apis/mock-apis/mocks/overview) and [Create a mock](https://learning.postman.com/docs/design-apis/mock-apis/mocks/create-a-mock).  
> Working with an AI coding agent? The [Postman plugin](https://github.com/postmanlabs/postman-plugin) can build and run mocks for you.  
> For current help, see the [Postman docs](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

We have a postman Mock Server that has been in place for over a year.

Today we are receiving lots of failures when sending to this and get response:  
502 Bad Gatewaynginx

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/1/9/1964e5a2038109ee8e92515f1b89792d5552a96d.png)

This is very sporadic - it seems to work around 9 times out of 10.

What causes this error for Mock Servers?  
Is there anything we can do to prevent it?

There have been no other network issues on our side.

This had not been an issue in the past and there have been no code changes or anything on our side. Is it possible a recent Postman update might have caused some issues?

Many thanks,  
Stuart

---

<div class="post-metadata">

**Author:** ![aditi139](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/aditi139/32/28708_2.png) [@aditi139](https://community.postman.com/u/aditi139)\
**Post date:** [May 21, 2024, 3:25pm UTC](https://community.postman.com/t/mock-server-502-bad-gateway/30737/2 "2024-05-21T15:25:38Z")

</div>

Hi Stuart, did you find a fix for this?  
I have been getting the same issue, and couldn’t find what might be causing it.
