Thanks Francis. I was able to get past this issue. Appreciate all the help.
Now I am stuck at forwarding the POST parameters to this proxy server.
proxy_pass http://$1:8080/clarity;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
#proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
If I uncomment 'proxy_set_header Host' and 'proxy_set_header X-Forwarded-For' it ends into 404 error. Otherwise it rewrites and proxies fine but doesnt pass the POST parameter.
Regards,
Neha