I'm trying to force https on my http endpoints using NGINX like so:
server {
location / {
root /data/www;
if ($http_x_forwarded_proto != 'https') {
rewrite ^ https://$host$request_uri? permanent;
}
}
location /images/ {
root /data;
}
}
Note that all im serving from nginx are static files (an HTML file, javascript file, and a coupl
My ELB health check is hitting HTTP:80/. So what I think it's happening, is that ELB tries to ping my server, hits that rewrite, and gets returned a 301? I've seen a lot of answers for ruby and node, but this is just static assets. Help!
Best Answer
Yep, ELB will hit your server via its IP (thus getting the default
server
block) and anything other than a 2xx request will be handled as a failure.We use a default server block for ELB to ping: