Quite common deployment is to run multiple web applications on the same domain and same server. I'm gonna show you now how to run jsreport in such a environment using nginx reverse proxy. This tutorial is specific for Ubuntu distribution, but it should be easily adaptable for other distributions.
sudo apt-get update
sudo apt-get install nginx
This automatically starts nginx web server and you should be able to hit the default page over http
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
npm install jsreport --production
node node_modules/jsreport --init
Edidprod.config.json
:
httpsPort
to "httpPort": 8080
"appPath": "/reporting"
Now start jsreport
npm start --production
You should be able to reach jsreport on http://localhost:8080
now
Replace file /etc/nginx/sites-available/default
with the one downloaded from here.
After restarting nginx, you should be able to reach jsreport on http://your-server/reporting
sudo service nginx restart