Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iframe展示pdf文件,开发环境正常显示,ngnix部署后就会重定向 #493

Open
kawhileo opened this issue Aug 28, 2024 · 0 comments

Comments

@kawhileo
Copy link

刚开始遇到的问题是部署后地址中使用代理就会重定向。改为从public下取地址,不使用nginx代理能正常显示pdf文件。
因为浏览器自带的iframe展示pdf,不同浏览器会展示不同的样式,所以后面改用pdfjs插件来展示。使用pdfjs时,是把pdfjs放置public/static下,然后通过iframe内嵌的方式进行展示,如:<iframe src="/static/pdfjs/web/viewer.html?file=http://192.168.1.10:9090/test/XXX.pdf">。经过测试发现开发环境怎么都是正常的,部署后如果viewer.html后没有?之后的参数,就能显示pdf插件,但是不能正常显示pdf里面的内容。如果加上?file后面的内容就会重定向。目前我自己判断是框架的原因。因为同样的nginx换一个框架是能正常显示的。请问有没有解决方案呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant