Thank you for your kind response.
However i don't think it's something related to the incompatibility of the ssl certificate with the browser because even without using the ssl certificate i still struggle. Please see the configurations made without encryption and see the error i am getting maybe it can give you a clue of what issue i am really facing.
Hello Everyone,
I am really facing challenges to setup nginx ssl reverse proxy for apache-tomcat. We have a need to apply self-signed ssl certificate on a reporting application built on jaspersoft. The jasper reports can be accessed on port 8080 but we want to change that port into 443 and apply self-signed ssl certificate. To achieve that, i installed nginx on the server and i can get the nginx welcome page. I created already the certificate to be deployed but the issue i am getting is to redirect the request to the apache-tomcat web server. Can someone help me please?
Below is what have done.
the configuration for /etc/nginx/nginx.config is as follow:
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
#include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See
http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*.conf;
server_names_hash_bucket_size 64;
}
Below is configuration of my proxy reverse in /etc/nginx/sites-available/jasper which is soft linked with /etc/nginx/sites-enabled/jasper
upstream tomcat_server {
# Tomcat is listening on default 8081 port
server 127.0.0.1:8080 weight=100 max_fails=5 fail_timeout=5;
}
server { listen 80;
server_name localhost;
# ssl on;
# ssl_session_timeout 5m;
# ssl_protocols SSLv2 SSLv2 TLSv1;
# ssl_certificate /etc/pki/tls/certs/ca.crt;
# ssl_certificate_key /etc/pki/tls/private/bi.key;
root /opt/jasperreports-server-cp-6.2.1/apache-tomcat/webapps/jasperserver;
access_log /var/log/nginx/somesite.org.access.log;
# index index.html index.htm index.xml;
# ssl_session_cache shared:SSL:10m;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass
http://127.0.0.1:8080/jasperserver;
}
}
On the apache-tomcat site I applied the following changes in /home/jasper/apache-tomcat/conf/server.xml:
<Connector port="8080" URIEncoding="UTF-8" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="80"
proxyName="localhost" proxyPort="80" scheme="http"/>
But when i browser to the page
http://192.168.1.128/jasperserver
i get the error message the page can't be displayed. But when i browser to
http://192.168.1.128 i get the nginx welcome page which means nginx is okay as well as
The access log is as below:
Myipaddress - - [17/Apr/2018:11:00:34 +0200] "GET /jasperserver/login.html HTTP/1.1" 404 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36 OPR/52.0.2871.40" "-"
Myipaddress - - [17/Apr/2018:11:01:16 +0200] "GET /jasperserver/login.html HTTP/1.1" 404 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36 OPR/52.0.2871.40" "-"
Myipaddress- - [17/Apr/2018:11:01:38 +0200] "GET /jasperserver/login.html HTTP/1.1" 404 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36 OPR/52.0.2871.40" "-"
Myipaddress - - [17/Apr/2018:11:01:39 +0200] "GET /jasperserver/login.html HTTP/1.1" 404 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36 OPR/52.0.2871.40" "-"
Myipaddress - - [17/Apr/2018:11:10:37 +0200] "GET /jasperserver HTTP/1.1" 404 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0" "-"
Myipaddress - - [17/Apr/2018:11:10:44 +0200] "GET /jasperserver HTTP/1.1" 404 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0" "-"
please let me know where the issue is.