PDF Viewer not working on secondary domain (Same site with multiple domains)

Hi,
I have one OJS site accessible via two domains: domain.com and domain.int. In the config.inc.php, the base_url is set to domain.com.

I’ve set up CORS to allow cross-origin access, but the built-in PDF viewer doesn’t work when accessed via domain.int. In the browser console, I get this error:

Uncaught (in promise) Error: file origin does not match viewer's
    at validateFileURL (app.js:1933:15)
    at webViewerInitialized (app.js:1978:5)

Everything works fine when using domain.com, but fails on domain.int.

Is there a way to make the PDF viewer work when accessing the site via the secondary domain?

Thanks in advance!

Did you configure the allowed_hosts setting in your config.inc.php?

I have a similar issue, but it’s not related to the domain. The PDF viewer stopped working after upgrading to version 3.5

Yes.

BTW
In the logs I see 404 Not Found

found the solution for my problem, I added MIME type application/javascript with an mjs extension in cPanel.

1 Like

My issue still persists - the comment above seems to refer to a different problem. Does anyone know how to solve this one?

I added MIME Type and extension but still did not open. An empty page as above picture.