Welcome! Log In Create A New Profile

Advanced

Problem with 'Host' http header when using ssl

November 05, 2014 12:04PM
I'm using Nginx as reverse proxy with SSL termination. The J2EE application that is behind it sometimes uses host information to create URLs for popup windows. Right now it inserts name of my upstream into URL and popup windows are not launched (obviously). I understand that i have to fill 'Host' header with appropriate value. So I tried to use
proxy_set_header Host $host;
inside my 'location' block. It works perfectly when I'm connecting over http. By when I'm connection over https it doesn't work (even more - all pages are not available).
My configuration:
upstream BE {
ip_hash;
server ... max_fails=1 fail_timeout=300s;
server ... max_fails=1 fail_timeout=300s;
}

server {
listen 443 ssl;
server_name localhost;

location / {
proxy_pass http://BE;
# proxy_redirect off;

#proxy_set_header X-Forwarded-Proto https;
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $host;
}

I found this post
http://forum.nginx.org/read.php?2,228638,228640#msg-228640
but it is not resolved.

Regards,
Ivan
Subject Author Posted

Problem with 'Host' http header when using ssl

Ivan Artyukhin November 05, 2014 12:04PM

Re: Problem with 'Host' http header when using ssl

Ivan Artyukhin November 05, 2014 12:05PM

Re: Problem with 'Host' http header when using ssl

itpp2012 November 05, 2014 12:47PM

Re: Problem with 'Host' http header when using ssl

Ivan Artyukhin November 05, 2014 02:49PM

Re: Problem with 'Host' http header when using ssl

itpp2012 November 05, 2014 04:57PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 161
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