Welcome! Log In Create A New Profile

Advanced

Proxy_pass

Posted by Athi 
Proxy_pass
December 16, 2019 04:44AM
I am trying to proxy public end point call https://login.microsoftonline.com/{tenant_id}/oauth2/token (POST request) to http://localhost/{tenant_id}/oauth2/token. This api call will be invoked inside an angular app. In order to avoid cors issue, I am trying to proxy the requests as same origin requests. I am using below location block in default.conf which is not working. Please advise.
location /{tenant_id} {
proxy_pass https://login.microsoftonline.com/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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