I have 7 services. I'd like them to automatically forward http->https.
I'm trying this, but it's not working:
map $http_host $backend {
apples.example.com http://127.0.0.1:3006;
oranges.example.com http://127.0.0.1:3000;
bananas.example.com http://127.0.0.1:3010;
pears.example.com http://127.0.0.1:3012;
dragonfruit.example.com http://127.0.0.1:3014;
peaches.example.com http://127.0.0.1:3002;
tomatos.example.com http://127.0.0.1:3016;
}
# All services (except button) forward HTTP -> HTTPS
server {
listen 80;
return 307 https://$http_host$request_uri;
}
I'm misunderstanding something because one of the services isn't matching up.
http://apples.example.com
is forwarding to https://peaches.example.com
I'm running this to test:
sudo service nginx restart && wget http://apples.example.com/ --no-check-certificate
And it's returning:
--2016-10-05 20:07:37-- http://apples.example.com/
Resolving expert-dev.bigsmall.io (apples.example.com)... 127.0.0.1
Connecting to expert-dev.bigsmall.io (apples.example.com)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 307 Temporary Redirect
Location: https://peaches.example.com [following]
--2016-10-05 20:07:37-- https://peaches.example.com/
nginx version: nginx/1.10.0 (Ubuntu)
Any suggestions?
0 Answers