1

I have a cloudfront url I want to route to demo.example.com. I used nginx for the routing and configuration and generated the ssl certificate and then added the txt records in the DNS portal.

But when I'm trying to access it, it is showing DNS_PROBE_FINISHED_NXDOMAIN and ERR_TOO_MANY_REDIRECTS errors. I might think that it should be possibly the configuration mistake is in nginx server.

My configuration goes like

 upstream apjpro_server_cloudfront {
               server d2yfna2c83xhjx.cloudfront.net;
}


'##demo.apjpro.com (cloudfront)
    server {
            listen 80;
            server_name demo.apjpro.com;
            location / {

                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header Host $host;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_connect_timeout       300;
                    proxy_send_timeout          300;
                    proxy_read_timeout          300;
                    send_timeout                300;
                    proxy_pass http://apjpro_server_cloudfront;
            }
           }
    server {
            listen 443;
            server_name demo.apjpro.com;
            ssl on;
            ssl_certificate /etc/letsencrypt/live/demo.apjpro.com/fullchain.pem;
            ssl_certificate_key /etc/letsencrypt/live/demo.apjpro.com/privkey.pem;
            ssl_protocols               TLSv1.1 TLSv1.2;

            location / {
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header Host $host;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_connect_timeout       300;
                    proxy_send_timeout          300;
                    proxy_read_timeout          300;
                    send_timeout                300;
                    proxy_ssl_server_name on;
                    proxy_pass http://apjpro_server_cloudfront;
            }

    }
Rohit Gupta
  • 356
  • 2
  • 4
  • 14

0 Answers0