Welcome! Log In Create A New Profile

Advanced

How to preserve nginx url from being redirected (302) from back end tomcat server?

December 12, 2015 02:45PM
Newby working for a couple weeks. Any guidance really appreciated.

Nginx is not preserving the url from redirected backend tomcat server.

Nginx url: //develop-application.example.com/

Backend tomcat url: //application.example.com/

tomcat redirects url: //application.example.com/application

I want the client browser url to always remain https://develop-application.example.com/application no matter what returns from tomcat.

Config:

server {
listen 443 proxy_protocol;
set_real_ip_from 0.0.0.0/0;
real_ip_header proxy_protocol;
access_log /var/log/nginx/develop-application.example.com.https.access.log elb_log;

server_name develop-application.example.com;

ssl on;
ssl_certificate /etc/nginx/ssl/example.com.crt.chained;
ssl_certificate_key /etc/nginx/ssl/example.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;

location / {

proxy_pass https://application.example.com/;
proxy_redirect https://application.example.com/ https://develop-application.example.com/;
proxy_set_header Host $http_host;

}
}
Subject Author Posted

How to preserve nginx url from being redirected (302) from back end tomcat server?

pjudt December 12, 2015 02:45PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 116
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready