# PDF.js Express Viewer not working via reverse proxies

**URL:** <https://pdfjs.community/t/pdf-js-express-viewer-not-working-via-reverse-proxies/1255>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [December 14, 2021, 7:02pm UTC](https://pdfjs.community/t/pdf-js-express-viewer-not-working-via-reverse-proxies/1255 "2021-12-14T19:02:12Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![nickmyersdt](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/nickmyersdt/32/628_2.png) [@nickmyersdt](https://pdfjs.community/u/nickmyersdt)\
**Post date:** [December 14, 2021, 7:02pm UTC](https://pdfjs.community/t/pdf-js-express-viewer-not-working-via-reverse-proxies/1255/1 "2021-12-14T19:02:12Z")

</div>

**Which product are you using?**  
PDF.js Express Viewer

**PDF.js Express Version**  
@pdftron/pdfjs-express-viewer: 8.1.1

**Detailed description of issue**  
We have replaced react-pdfwith pdfjs-express-viewer on our website [https://edu.digitaltheatreplus.com](https://edu.digitaltheatreplus.com). It is working for most of our customers, except for those that use our website via a reverse proxy (which has a different domain name) for example: [https://edu-digitaltheatreplus-com.eu1.proxy.openathens.net](https://edu-digitaltheatreplus-com.eu1.proxy.openathens.net)

We have examined HAR files from customers, and see that the request to GET /auth.pdfjs.express/  
returns a 200 and a key, however, users do not see the PDF, they see the following:

![Screenshot 2021-12-09 at 23.11.55](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/9bfac5e2ddc625a8faad2f6b69d3b56bf74b7dae.png)

My assumption is that the problem is that the key doesn’t validate the domain/referrer, is that correct? Is there a way to generate a key that allows for the same website to work via reverse proxy/different domains?

Any ideas of advice would be gratefully received, this was implemented by a developer in haste before they left our business, so I’m left with the decision of finding a way to make PDF.js Express Viewer work via reverse proxy, or roll back to our old react-pdf implementation.

**Expected behaviour**  
PDF document is displayed

**Does your issue happen with every document, or just one?**  
Every document when loaded by a reverse proxy (we have about 1500 customers using either OpenAthens, WAM Proxy or EZProxy)

**Link to document**  
Unfortunately they are behind a paywall, also, you’d need to be using a reverse proxy to reproduce issue.

**Code snippet**

```javascript
const PdfViewer = dynamic(
  () => import('../../../media/components/pdf-viewer'),
  { ssr: false }
);
...
        <PdfViewer
            key={[
              guide.media.url,
              printAndDownloadDisabled,
              outlineHidden,
            ].join()}
            pdfUrl={guide.media.url}
            pdfTitle={guide.name}
            disablePrintAndDownload={printAndDownloadDisabled !== 'off'}
            hideOutline={outlineHidden}
          />

```

---

_[View the full topic](https://pdfjs.community/t/pdf-js-express-viewer-not-working-via-reverse-proxies/1255)._
