Authentication webserver behind nginx rps

Hi,

My reverse proxy setup is like this

http://nginx_rps —> https://authwebser:443 ( I dont have access to
authserver )

The reverse proxy is correctly redirecting when I access the
http://nginx_rps through browser. But when I type the credentials
correctly
in the webpage it is giving credential error. That means nginx is not
correctly passing the credentials to authserver over ssl. What is wrong
with my setup. Do I need to modify anything ?

server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;

    root /usr/share/nginx/html;
    index index.html index.htm;

    # Make site accessible from http://localhost/

server_name localhost;

    server_name XXXXXXXXX;
    access_log  /var/log/nginx/access.log;
    location / {
            # First attempt to serve request as file, then
            # as directory, then fall back to displaying a 404.
            proxy_set_header Host $host;
            proxy_set_header Host $host;
            proxy_set_header Accept-Encoding "";
            proxy_set_header X-Real-IP $remote_addr;

            proxy_pass      https://XXXXXXXXXX 

https://54.165.9.92;

            #include                /etc/nginx/proxy.conf;

try_files $uri $uri/ =404;

            # Uncomment to enable naxsi on this location
            # include /etc/nginx/naxsi.rules
    }

    # Only for nginx-naxsi used with nginx-naxsi-ui : process denied

requests

What needs to be done so that the authentication happens correctly over
ssl
from nginx to authserver.

Regards
T