Welcome! Log In Create A New Profile

Advanced

Reverse proxy SSL redirect issue

Posted by jbeaulau 
Reverse proxy SSL redirect issue
June 30, 2020 02:35PM
Hello,

I have an app running SSL that I need to configure a front end proxy too. I have chosen
NGINX as the proxy. I have configured NGINX to redirect HTTP calls to HTTPS and proxy
the URL. However when I test HTTP call using Postman I get a 415 "Unsupported Media
Type in Header" error. If I change to HTTPS in the GET URL in Postman I get the desired
response and can see the proxy is being used. So the issue as I see it is in the redirect is
striping a header or causing some other issue. Below is the config I’m using. Would very
much appreciate some SME input.


server {
listen 80 default_server;
server_name server.foo.com;

rewrite ^ https://$server_name$request_uri? permanent;

root /application_path/webapps/;
# /usr/share/nginx/html;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}

}

# Settings for a TLS enabled server.
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name server.foo.com;
root /application_path/webapps;
# /usr/share/nginx/html;

ssl_certificate "/some_path/foo.chain.cert";
ssl_certificate_key "/some_path/foo.key";
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;


# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;


location /foo {

proxy_pass https://server.foo.com:8443/foo;
}

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}

}


Thank you
-John
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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