Welcome! Log In Create A New Profile

Advanced

Nginx with Liferay (Tomcat) SSL+LB

Posted by osc 
osc
Nginx with Liferay (Tomcat) SSL+LB
November 15, 2012 03:38AM
Hi Guys,

i want to run Nginx as loadbalancer and ssl termination.

client<--ssl-->nginx<--http-->backend

My problem is that css is not working/downloaded.
Is there something to edit in tomcat ?

My nginx.conf

worker_processes 1;
#error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;

#pid /var/run/nginx.pid;


events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
#Access Log
access_log /var/log/nginx/access.log;
#Cache Pfad
proxy_cache_path /tmp/nginx/cache levels=1:2 keys_zone=one:10m;
sendfile on;
tcp_nopush on;
#keepalive_timeout 30;
keepalive_timeout 65;
tcp_nodelay on;
#Daten werden gepackt
gzip on;
# Ausser für IE bis 7
gzip_disable "MSIE [1-6]\.(?!.*SV1)";

upstream backend {
server 192.168.21.113:8080;
}

server {
listen 80;
server_name 192.168.21.43;
rewrite ^(.*) https://192.168.21.43/request_uri? permanent;
}

server {
listen 443;
server_name 192.168.21.43;
ssl on;
ssl_certificate /etc/nginx/cert/server.crt;
ssl_certificate_key /etc/nginx/cert/server.key;
location / {
proxy_pass http://backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;


}
}
}

Thanks for your help.
Attachments:
open | download - pic1.png (158.4 KB)
open | download - pic2.png (242.5 KB)
Re: Nginx with Liferay (Tomcat) SSL+LB
January 18, 2015 11:33AM
Hi OSC!

I have same problem, and here's the solution:

The web browsers brake the connections between nginx and liferay! You want to connect from ssl server ( nginx ) to not ssl server( liferay ) and it's unsecure for the web browsers.
Create a self-signed certificate for Tomcat and setup the tomcat for ssl connection ( eg. listening on 8443 port ). After If it's works you change the upstream section in nginx.conf

upstream backend {
server 192.168.21.113:8443;
}

Restart nginx, and the css will works!

Regards,
Koqsz
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 154
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready