Quantcast
Viewing all articles
Browse latest Browse all 1609

Can I use both HTTP and HTTPS in nginx upstream?

I have Nginx config as below:

upstream staging {    server myappstaging.somedomain.com;}upstream prod {    server myapp.somedomain.com:443;}# map to different upstream backends based on headermap $http_x_server_select $pool {    default "prod";    staging "staging";}server {    listen 80;    server_name myapp.mydomain.com;    location / {        proxy_pass https://$pool;    }}

I want to forward requests with x-server-select header set to staging to http://myappstaging.somedomain.com and for prod to https://myapp.somedomain.com:443

Is it possible do that with Nginx ?


Viewing all articles
Browse latest Browse all 1609

Trending Articles