Setup Jasper Reporting Server through NGINX virtual host with SSL in Windows

Jasper server is running top of a Tomcat instance and by default it uses the port 8080.
All jasper related files located inside the webapp folder

Ex- C:\Jaspersoft\jasperreports-server-cp-6.4.2\apache-tomcat\webapps\jasperserver

First we will set jasper to run on the http://localhost:8080 instead of http://localhost:8080/jasperserver
to do that, we will make a folder called webapps2 in apache-tomcat folder and inside that we will create a ROOT directory.
Then, we have to copy apache-tomcat/webapps/jasperserver content to newly created apache-tomcat/webapps/ROOT/ folder.
After that, we have to tell tomcat to look into our new webapps2 folder instead of webapps folder, to do that

Open apache-tomcat/conf/server.xml and change the appBase to webapps2

Restart the jasper service or tomcat and now you can see your jasper server run on http://localhost:8080

Configuring the Virtual Host

Open windows host file (C:\Windows\System32\drivers\etc\hosts) and add below line


127.0.0.1 reporting.duminda.com

Installing NGINX and setup as a windows service

Download NGINX for windows and extract it into your C:/ drive
Your NGINX HOME would be C:\nginx-1.15.2

open nginx.conf file located in conf directory and add below section


server {

listen 443 ssl;
server_name reporting.duminda.com;

access_log logs/reporting.duminda.com.access.log;

ssl_certificate C:/Users/Duminda/certificate.crt;
ssl_certificate_key C:/Users/Duminda/private-key.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;

ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

location / {

proxy_pass http://127.0.0.1:8080/;

}
}

Create crt and key files in your machine and replace ssl_certificate (your Self Signed Certificate) ,ssl_certificate_key with appropriate paths.

Above configuration will create a virtual host and point to our jasper server.

So all the incoming requests receiving to https://reporting.duminda.com will pass to http://127.0.0.1:8080

Setup NGINX as a windows service

Download NSSM (https://nssm.cc/download) and install service by executing below command (as admin)


nssm.exe install nginx

1

Set arguments as -p C:\nginx-1.15.2

Now you have installed nginx service, go to windows services and start the nginx

Visit the https://reporting.duminda.com and enjoy jaspering ….