This guide explains how to configure a reverse proxy so that your application can proxy requests to PrizmDoc Viewer.
With PrizmDoc Viewer you can convert many different document types to ViewingPackages
which can then be viewed with the PDF Viewer. This How-To will require access to a PrizmDoc Server instance. The PDF Viewer requires access to the PrizmDoc Server to request content for Viewing Sessions for previously created Viewing Packages. See the topic, How-To: View a Viewing Package for instructions on the creation of a Viewing Package and viewing it’s content.
There are many different tools available to provide an application with a reverse proxy to a back-end server depending on which framework you are using. Examples include http-proxy-middleware for node.js and express, SharpReverseProxy for ASP.NET, Netflix Zuul for Java Spring. For framework agnostic solutions, IIS and NGINX are popular tools. This example will demonstrate configuring a reverse proxy using NGINX.
PDF Viewer requires access to PrizmDoc Server to request content for a Viewing Package. Therefore, NGINX will provide both hosting for the application and a reverse proxy for the requests to PrizmDoc Server. This example nginx.conf
file will configure NGINX to serve the application root
from an /app/www
directory:
events {}
http {
server {
listen 80;
location / {
root /app/www;
}
}
}
Note that this is a simple example to show how to set up a reverse proxy with NGINX. In a production environment, care should be taken to ensure good security and best practices.
Adding the section below to the nginx.conf
file will enable requests to proxy through a prizmdoc
route to a PrizmDoc server using proxy_pass
:
events {}
http {
server {
listen 80;
location / {
root /app/www;
}
location /prizmdoc/ {
proxy_pass https://my-prizmdoc-server.my-domain.com/;
}
}
}
The example can then be started with the command line below:
nginx -c /app/nginx.conf
Once NGINX is started, all /prizmdoc/*
requests will be proxied to the https://my-prizmdoc-server.my-domain.com/
.