questions on configure nginx load balancing + tomcat + ssl
Posted: Mon May 26, 2014 6:15 am
Hi guys,
Have you configured nginx + tomcat + ssl for broadleaf commerce demo site?
I tried to build the test environment based on this, but just took me a very long time to eveb get close.
My idea is to build http and https on nginx, and leave tomcat serve http, because nginx -> tomcat will run in the internal networks, most likely on the same server.
I understand there are half dozen directories required https channel; my problem is I don't get how to write passProxy rules or rewrite rules to cover them.
here is my nginx conf
server {
listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default ipv6only=on; ## listen for ipv6
index index.html index.htm;
# Make site accessible from http://localhost/
server_name MyHostName;
error_page 403 /403.html;
error_page 404 /403.html;
location = /403.html {
root /opt/instance/http;
allow all;
}
location ^/login {
#|/register*|/account/**|/checkout/**|/null-checkout/**|/null-giftcard/**|/confirmation/**)$ {
rewrite ^ https://$http_host$request_uri? permanent; # this doesn't work
}
location /{
proxy_pass http://127.0.0.1:8080;
}
}
-------------------------------
Anyone can help me please?
Thank you
Dan
Have you configured nginx + tomcat + ssl for broadleaf commerce demo site?
I tried to build the test environment based on this, but just took me a very long time to eveb get close.
My idea is to build http and https on nginx, and leave tomcat serve http, because nginx -> tomcat will run in the internal networks, most likely on the same server.
I understand there are half dozen directories required https channel; my problem is I don't get how to write passProxy rules or rewrite rules to cover them.
here is my nginx conf
server {
listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default ipv6only=on; ## listen for ipv6
index index.html index.htm;
# Make site accessible from http://localhost/
server_name MyHostName;
error_page 403 /403.html;
error_page 404 /403.html;
location = /403.html {
root /opt/instance/http;
allow all;
}
location ^/login {
#|/register*|/account/**|/checkout/**|/null-checkout/**|/null-giftcard/**|/confirmation/**)$ {
rewrite ^ https://$http_host$request_uri? permanent; # this doesn't work
}
location /{
proxy_pass http://127.0.0.1:8080;
}
}
-------------------------------
Anyone can help me please?
Thank you
Dan