LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-23-2018, 12:54 PM   #31
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,174
Blog Entries: 1

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040

Quote:
The tomcat is listening on port 8080. In my previous texts I was trying to access jasperserver through nginx on port 8083. When everything worked fine, I then changed the nginx port from 8083 to 8443 to access jasperserver using https instead of http. After I changed that it's when complications started. In fact when i try to login into jasperserver i am getting redirected to another link as I told you earlier which is https://192.168.1.128:8443/j_spring_security_check.
You mean that it works using http (nginx port 8083) and doersn't work with https (nginx port 8443)?
Maybe it gets confused because by default if you enable ssl on tomcat, it listens on port 8443. Change the nginx ssl port (use the default 443) and see what you get.
 
Old 04-24-2018, 11:02 AM   #32
usfrank02
LQ Newbie
 
Registered: Apr 2018
Posts: 17

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
You mean that it works using http (nginx port 8083) and doersn't work with https (nginx port 8443)?
Maybe it gets confused because by default if you enable ssl on tomcat, it listens on port 8443. Change the nginx ssl port (use the default 443) and see what you get.
@Bathory,

I abandoned to setup the nginx for reverse proxy as I was not able to fix the issues i was facing. I went for apache reverse proxy which is working fine for me.
Thank you anyway for your willingness to support.

regards,
 
Old 10-25-2023, 10:09 PM   #33
manit77
LQ Newbie
 
Registered: Oct 2023
Posts: 1

Rep: Reputation: 0
got it working

Took me several hours to figure this out mainly because the process takes so long to restart. Hope this will help someone.

this config is for jasperreports-server-cp-8.2.0


apache-tomcat/webapps/jasperserver/WEB-INF/web.xml
// add cors filter

<!-- add cors filter -->
<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
<init-param>
<param-name>cors.allowed.origins</param-name>
<param-value>#h#t#t#p#://localhost:8002</param-value>
</init-param>
<init-param>
<param-name>cors.allowed.methods</param-name>
<param-value>GET,POST,HEAD,PUT,OPTIONS,DELETE,PATCH</param-value>
</init-param>
<init-param>
<param-name>cors.allowed.headers</param-name>
<param-value>Cache-Control,X-Suppress-Basic,Origin,Accept,X-Requested-With,Content-Type,Pragma,accept-timezone,withCredentials,X-Remote-Domain,X-Is-Visualize,x-jrs-base-url,Content-Disposition,Content-Description</param-value>
</init-param>
<init-param>
<param-name>cors.exposed.headers</param-name>
<param-value></param-value>
</init-param>
<init-param>
<param-name>cors.support.credentials</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>cors.preflight.maxage</param-name>
<param-value>300</param-value>
</init-param>
</filter>

<filter-mapping>
<filter-name>CorsFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>CorsFilter</filter-name>
<url-pattern>*.woff</url-pattern>
</filter-mapping>

//Disabel CSRF
apache-tomcat/webapps/jasperserver/WEB-INF/csrf/jrs.csrfguard.properties
apache-tomcat/webapps/jasperserver/WEB-INF/csrf/Websphere.jrs.csrfguard.properties //not sure if this is needed


org.owasp.csrfguard.Enabled = false
org.owasp.csrfguard.Ajax=false

// deal with underscores with nginx
// rename all instances of OWASP_CSRFTOKEN to OWASP-CSRFTOKEN (with a dash)
// could not get this to work in nginx underscores_in_headers on;

including this file: WEB-INF/csrf/Websphere.jrs.csrfguard.properties


NGINX Config:


server {
listen 443 ssl;
ssl on;
server_name reports.xxxx.com;
underscores_in_headers on;
add_header Referrer-Policy "no-referrer-when-downgrade, origin-when-cross-origin" always;

ssl_certificate /var/www/certs/certfullchain.cer;
ssl_certificate_key /var/www/certs/cert.key;

location /jasperserver {
proxy_pass h-t-t-p://10.20.1.100;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real_IP $remote_addr;

}
}


//didn't need a CookieProcessor in META-INF/context.xml
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Reverse SSL proxy for Apche Tomcat lpwevers Linux - Server 10 08-29-2022 07:38 AM
LXer: How to set-up Tomcat 8 with Nginx reverse proxy on an Ubuntu 14.04 VPS LXer Syndicated Linux News 0 06-01-2015 07:12 PM
Nginx Reverse proxy on a internal apache reverse server ITiger Linux - Software 0 04-25-2014 07:44 AM
[SOLVED] Nginx as SSL Reverse Proxy mosiac Linux - Server 6 07-18-2013 03:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration