https is not working with my installed ssl (nginx & letsencrypt)











up vote
0
down vote

favorite












I have installed ssl certificate using letsencrypt in my nginx server. it works perfectly in the follwoing domain:
http://shajao.com



site gets redirected perfectly. and ssl is working nicely with an A+ score in ssllabs



i followed this instruction:
https://medium.com/@jnwarp/lets-encrypt-configure-nginx-with-a-perfect-score-on-ssl-labs-6fc10d2e4bf7



But i tried to do the same thing on same server but different domain name but cant get it to work.
Basically ssl is not working. So when i hit the domain in browser it starts a infinite redirection loop. So i stopped the http to https redirect and found that https is not working which gets the site redirected to http.



My dns is managed using cloudflare and i tried turning off the ssl feature from there as well.



Cloudflare ssl off



My server code:



server {
listen 80;
listen [::]:80;
server_name getcoursetube.com www.getcoursetube.com;
root /media/6sense/www/getcoursetube.com;
index index.html index.htm index.nginx-debian.html;
# return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;

root /media/6sense/www/getcoursetube.com;
index index.html index.htm index.nginx-debian.html;
server_name getcoursetube.com www.getcoursetube.com;
location / {
try_files $uri$args $uri$args/ /index.html;
}

error_log /media/6sense/www/getcoursetube.com/logs/error.log;
access_log /media/6sense/www/getcoursetube.com/logs/access.log;

#WARNING: Please read before adding the lines below!
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;

ssl_certificate /etc/letsencrypt/live/getcoursetube.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/getcoursetube.com/privkey.pem;
ssl_trusted_certificate /etc/nginx/ssl/chain.pem;
}









share|improve this question




























    up vote
    0
    down vote

    favorite












    I have installed ssl certificate using letsencrypt in my nginx server. it works perfectly in the follwoing domain:
    http://shajao.com



    site gets redirected perfectly. and ssl is working nicely with an A+ score in ssllabs



    i followed this instruction:
    https://medium.com/@jnwarp/lets-encrypt-configure-nginx-with-a-perfect-score-on-ssl-labs-6fc10d2e4bf7



    But i tried to do the same thing on same server but different domain name but cant get it to work.
    Basically ssl is not working. So when i hit the domain in browser it starts a infinite redirection loop. So i stopped the http to https redirect and found that https is not working which gets the site redirected to http.



    My dns is managed using cloudflare and i tried turning off the ssl feature from there as well.



    Cloudflare ssl off



    My server code:



    server {
    listen 80;
    listen [::]:80;
    server_name getcoursetube.com www.getcoursetube.com;
    root /media/6sense/www/getcoursetube.com;
    index index.html index.htm index.nginx-debian.html;
    # return 301 https://$host$request_uri;
    }
    server {
    listen 443 ssl;
    listen [::]:443 ssl;

    root /media/6sense/www/getcoursetube.com;
    index index.html index.htm index.nginx-debian.html;
    server_name getcoursetube.com www.getcoursetube.com;
    location / {
    try_files $uri$args $uri$args/ /index.html;
    }

    error_log /media/6sense/www/getcoursetube.com/logs/error.log;
    access_log /media/6sense/www/getcoursetube.com/logs/access.log;

    #WARNING: Please read before adding the lines below!
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    add_header X-Frame-Options DENY;
    add_header X-Content-Type-Options nosniff;

    ssl_certificate /etc/letsencrypt/live/getcoursetube.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/getcoursetube.com/privkey.pem;
    ssl_trusted_certificate /etc/nginx/ssl/chain.pem;
    }









    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have installed ssl certificate using letsencrypt in my nginx server. it works perfectly in the follwoing domain:
      http://shajao.com



      site gets redirected perfectly. and ssl is working nicely with an A+ score in ssllabs



      i followed this instruction:
      https://medium.com/@jnwarp/lets-encrypt-configure-nginx-with-a-perfect-score-on-ssl-labs-6fc10d2e4bf7



      But i tried to do the same thing on same server but different domain name but cant get it to work.
      Basically ssl is not working. So when i hit the domain in browser it starts a infinite redirection loop. So i stopped the http to https redirect and found that https is not working which gets the site redirected to http.



      My dns is managed using cloudflare and i tried turning off the ssl feature from there as well.



      Cloudflare ssl off



      My server code:



      server {
      listen 80;
      listen [::]:80;
      server_name getcoursetube.com www.getcoursetube.com;
      root /media/6sense/www/getcoursetube.com;
      index index.html index.htm index.nginx-debian.html;
      # return 301 https://$host$request_uri;
      }
      server {
      listen 443 ssl;
      listen [::]:443 ssl;

      root /media/6sense/www/getcoursetube.com;
      index index.html index.htm index.nginx-debian.html;
      server_name getcoursetube.com www.getcoursetube.com;
      location / {
      try_files $uri$args $uri$args/ /index.html;
      }

      error_log /media/6sense/www/getcoursetube.com/logs/error.log;
      access_log /media/6sense/www/getcoursetube.com/logs/access.log;

      #WARNING: Please read before adding the lines below!
      add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
      add_header X-Frame-Options DENY;
      add_header X-Content-Type-Options nosniff;

      ssl_certificate /etc/letsencrypt/live/getcoursetube.com/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/getcoursetube.com/privkey.pem;
      ssl_trusted_certificate /etc/nginx/ssl/chain.pem;
      }









      share|improve this question















      I have installed ssl certificate using letsencrypt in my nginx server. it works perfectly in the follwoing domain:
      http://shajao.com



      site gets redirected perfectly. and ssl is working nicely with an A+ score in ssllabs



      i followed this instruction:
      https://medium.com/@jnwarp/lets-encrypt-configure-nginx-with-a-perfect-score-on-ssl-labs-6fc10d2e4bf7



      But i tried to do the same thing on same server but different domain name but cant get it to work.
      Basically ssl is not working. So when i hit the domain in browser it starts a infinite redirection loop. So i stopped the http to https redirect and found that https is not working which gets the site redirected to http.



      My dns is managed using cloudflare and i tried turning off the ssl feature from there as well.



      Cloudflare ssl off



      My server code:



      server {
      listen 80;
      listen [::]:80;
      server_name getcoursetube.com www.getcoursetube.com;
      root /media/6sense/www/getcoursetube.com;
      index index.html index.htm index.nginx-debian.html;
      # return 301 https://$host$request_uri;
      }
      server {
      listen 443 ssl;
      listen [::]:443 ssl;

      root /media/6sense/www/getcoursetube.com;
      index index.html index.htm index.nginx-debian.html;
      server_name getcoursetube.com www.getcoursetube.com;
      location / {
      try_files $uri$args $uri$args/ /index.html;
      }

      error_log /media/6sense/www/getcoursetube.com/logs/error.log;
      access_log /media/6sense/www/getcoursetube.com/logs/access.log;

      #WARNING: Please read before adding the lines below!
      add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
      add_header X-Frame-Options DENY;
      add_header X-Content-Type-Options nosniff;

      ssl_certificate /etc/letsencrypt/live/getcoursetube.com/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/getcoursetube.com/privkey.pem;
      ssl_trusted_certificate /etc/nginx/ssl/chain.pem;
      }






      ssl nginx https server cloudflare






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited yesterday

























      asked yesterday









      Ahsan Aasim

      12211




      12211
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          After spending hours, i tested my cerificate on digicert. And found that digicert is showing a ssl certificate that is issued by cloudflare.



          I turned off ssl from cloudflare but it didnt work. So i had to quit cloudflare.
          I removed my site from cloudflare and managed my dns through godaddy (from where i purchased my domain). And it worked perfectly.



          Let me know if anybody has better answer and made it work through cloudflare as well.






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53349206%2fhttps-is-not-working-with-my-installed-ssl-nginx-letsencrypt%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            After spending hours, i tested my cerificate on digicert. And found that digicert is showing a ssl certificate that is issued by cloudflare.



            I turned off ssl from cloudflare but it didnt work. So i had to quit cloudflare.
            I removed my site from cloudflare and managed my dns through godaddy (from where i purchased my domain). And it worked perfectly.



            Let me know if anybody has better answer and made it work through cloudflare as well.






            share|improve this answer

























              up vote
              0
              down vote













              After spending hours, i tested my cerificate on digicert. And found that digicert is showing a ssl certificate that is issued by cloudflare.



              I turned off ssl from cloudflare but it didnt work. So i had to quit cloudflare.
              I removed my site from cloudflare and managed my dns through godaddy (from where i purchased my domain). And it worked perfectly.



              Let me know if anybody has better answer and made it work through cloudflare as well.






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                After spending hours, i tested my cerificate on digicert. And found that digicert is showing a ssl certificate that is issued by cloudflare.



                I turned off ssl from cloudflare but it didnt work. So i had to quit cloudflare.
                I removed my site from cloudflare and managed my dns through godaddy (from where i purchased my domain). And it worked perfectly.



                Let me know if anybody has better answer and made it work through cloudflare as well.






                share|improve this answer












                After spending hours, i tested my cerificate on digicert. And found that digicert is showing a ssl certificate that is issued by cloudflare.



                I turned off ssl from cloudflare but it didnt work. So i had to quit cloudflare.
                I removed my site from cloudflare and managed my dns through godaddy (from where i purchased my domain). And it worked perfectly.



                Let me know if anybody has better answer and made it work through cloudflare as well.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered yesterday









                Ahsan Aasim

                12211




                12211






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53349206%2fhttps-is-not-working-with-my-installed-ssl-nginx-letsencrypt%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Create new schema in PostgreSQL using DBeaver

                    Deepest pit of an array with Javascript: test on Codility

                    Costa Masnaga