# 502 Bad Gateway - nginx after RUM Injection

**URL:** <https://community.dynatrace.com/t/502-bad-gateway-nginx-after-rum-injection/38966>\
**Category:** Open Q&A\
**Tags:** nginx, real-user-monitoring-classic\
**Created:** [March 23, 2023, 11:23am UTC](https://community.dynatrace.com/t/502-bad-gateway-nginx-after-rum-injection/38966 "2023-03-23T11:23:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarcoCritti](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marcocritti/32/8974_2.png) [@MarcoCritti](https://community.dynatrace.com/u/MarcoCritti)\
**Post date:** [March 23, 2023, 11:23am UTC](https://community.dynatrace.com/t/502-bad-gateway-nginx-after-rum-injection/38966/1 "2023-03-23T11:23:20Z")

</div>

Hello everyone

We rolled out Dynatrace to our Kubernetes Azure Cluster, We have a landingpage which redirects to another page.  
However with RUM on for the landiongpage we get now a **502 Bad Gateway** message. If I refresh the page the redirection works fine, however in case I remove the **dtCookie** the redirection doesnt work and I still have the same error message.

My quick solution is to add the website for the landing page and \*\*disable RUM.

The redirect is done via [Migrate applications and APIs to b2clogin.com - Azure AD B2C | Microsoft Learn](https://learn.microsoft.com/en-us/azure/active-directory-b2c/b2clogin) (Set redirect URLs to [b2clogin.com](http://b2clogin.com) for Azure Active Directory B2C)\*\*

Any Ideas what could be the issue?

Thanks and cheers  
Marco

---

<div class="post-metadata">

**Author:** ![Mohamed\_Hamdy](https://avatars.discourse-cdn.com/v4/letter/m/7ab992/32.png) [@Mohamed\_Hamdy](https://community.dynatrace.com/u/Mohamed_Hamdy)\
**Post date:** [March 24, 2023, 9:17pm UTC](https://community.dynatrace.com/t/502-bad-gateway-nginx-after-rum-injection/38966/2 "2023-03-24T21:17:29Z")

</div>

Hi Marco,  
to be honest, I don’t know what is the issue exactly, but you can add a custom injection rule from the app settings to prevent the injection for this URL.

 ![Mohamed_Hamdy_0-1679692529003.png](https://global.discourse-cdn.com/dynatrace/original/3X/5/6/56ad7ad82deca9b1d3d0ebcb509c66ced474fda2.png)

and for XHR you can add an XHR exclusion rule.

 ![Mohamed_Hamdy_1-1679692617542.png](https://global.discourse-cdn.com/dynatrace/original/3X/c/3/c3ee2e8dbd27e2bf0750796e029b03e1106bfa90.png)
