Preview Document is giving me Bad Gateway error

Hello, after I make changes to a previous document, then press save and attempt to preview on our staging site, the newly opened URL which would usually give me a preview is instead giving me a "bad gateway" error. We believe this to be a server-side issue on your end. Please help, as the issue has not resolved itself after 24 hours.

Hello @courtney.meznarich

Thanks for reaching out to us.

It would be great if you could provide me more details, like:

  1. Were Previews working before?
  2. Have you done Previews configuration in your repository?
  3. What framework are you using so I can guide you accordingly?

Thanks,
Priyanka

Hi Priyanka,

  1. Yes, for years, and we have not changed anything
  2. Yes
  3. Angular built on a custom site

Thanks, @courtney.meznarich, for getting back to me.

If Previews were working before and not working now, it might be an issue of cookies. Can you try to delete preview cookies and run it again? Are you a developer? If not, you might need a developer to clear cookies?

Let me know if it solves your issue or you have any further questions related to it.

Thanks,
Priyanka

Hi Priyanka, I am not a developer but I have tried clearing the cookies and hard reloading, as that has worked for me in the past when I had trouble with previewing. It is not working now, it's a totally different error with the "bad gateway" message. When previews have broken in the past, I simply get a blank page. But now, the preview page attempts to load for a very long time (maybe a minute or so) before turning out the bad gateway error.

I need to take a deeper look into it. For this, I need:

  1. The Prismic repo URL.
  2. Your project source code.
  3. Screenshot of the error.

Thanks,
Priyanka

Hi Priyanka,

  1. socreate.prismic.io
  2. static addPrismicPreviewScript(elementRef: ElementRef): void {
    const s = document.createElement('script');
    s.type = 'text/javascript';
    s.src = '//static.cdn.prismic.io/prismic.min.js?new=true&repo=socreate';
    elementRef.nativeElement.appendChild(s);

Hello @courtney.meznarich

Thanks for sending that information, but It is difficult for me to debug it. To debug the code, I need a complete project code, either a Zip file or a Github repo.

And one more question: Are Previews working in the Development environment?

Thanks,
Priyanka

Hello Priyanka, thank you for your patience. Our team has continued working on the issue on our end as I worked through possible solutions with you, and they found out that there was a configured DNS issue in our cloud. We have solved the problem. Thank you!

Hello @courtney.meznarich

I am glad that it works for you. Feel free to reach out to us if you have any questions.

Thanks,
Priyanka