Can't turn SSL on a docker's nginx containerNginx gives 504 Gateway Time-out once moved to liveNginx...

How do you say “my friend is throwing a party, do you wanna come?” in german

How to disable or uninstall iTunes under High Sierra without disabling SIP

Difference between 'stomach' and 'uterus'

Lock enemy's y-axis when using Vector3.MoveTowards to follow the player

What is the difference between a forward slip and a side slip?

If there are any 3nion, 5nion, 7nion, 9nion, 10nion, etc.

Why won't the strings command stop?

Practical reasons to have both a large police force and bounty hunting network?

When to use mean vs median

Was it really inappropriate to write a pull request for the company I interviewed with?

How to kill a localhost:8080

Inconsistent behaviour between dict.values() and dict.keys() equality in Python 3.x and Python 2.7

Why use a Gaussian mixture model?

Did Amazon pay $0 in taxes last year?

Movie: Scientists travel to the future to avoid nuclear war, last surviving one is used as fuel by future humans

Should I use HTTPS on a domain that will only be used for redirection?

How to roleplay my character's ethics according to the DM when I don't understand those ethics?

Why do phishing e-mails use faked e-mail addresses instead of the real one?

Is there a frame of reference in which I was born before I was conceived?

I can't die. Who am I?

Is the NES controller port identical to the port on a Wii remote?

Sometimes a banana is just a banana

How does insurance birth control work?

Is divide-by-zero a security vulnerability?



Can't turn SSL on a docker's nginx container


Nginx gives 504 Gateway Time-out once moved to liveNginx subversion commit failureNGINX don't parse .php5 as .phpLaravel 4.1 on nginx routes error 404nginx rewrite throw 404 with last and breakNginX + WordPress + SSL + non-www + W3TC vhost config file questionsnginx PHP files downloading instead of executingCodeIgniter nginx rewrite rules for i8ln URL'sHow to serve Autodiscover.xml using NginxWhy Nginx calls for invalid certificate in non-existent subdomains just to redirect to 404?













0















I'm new to docker and try to build an image based on Alpine to take care of my websites with HTTPS connexions.
Currently i'm at the step to make it work from the container so i'm not finished yet with my Dockerfile
my Dockerfile :



FROM alpine


RUN apk update
&& apk upgrade
&& apk add nginx php7 php7-fpm php7-opcache php7-gd php7-mysqli php7-zlib php7-curl
&& mkdir /run/nginx
EXPOSE 80


From there i start my container :



docker run -ti -p 80:80 -p 443:442 -v /home/docker/web/conf:/etc/nginx/conf.d/ -v /home/docker/web/www:/var/www/localhost/htdocs test


I then install certbot-nginx, and start it to generate my certificate, which i copy in my /var/www/localhost/htdocs/example.fr/ to access it from outside the container.
Finally i start php-fpm7 & nginx.



My nginx config :



server {
server_name example.fr;
root /var/www/localhost/htdocs/example.fr;
index index.html index.htm index.php;
listen [::]:443 ssl;
server_tokens off;
# configure php
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
index index.html index.htm index.php;
}

location ~* .pem {
deny all;
}

ssl_certificate /var/www/localhost/htdocs/example.fr/fullchain.pem;
ssl_certificate_key /var/www/localhost/htdocs/example.fr/privkey.pem; # managed by Certbot

}

server {
if ($host = example.fr) {
return 301 https://$host$request_uri;
}
# managed by Certbot
server_name example.fr;
listen 80;
listen [::]:80;
#return 404;
}


I'm probably missing something simple but i'm stuck since a week.
thanks !










share|improve this question







New contributor




idiocrate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I'm new to docker and try to build an image based on Alpine to take care of my websites with HTTPS connexions.
    Currently i'm at the step to make it work from the container so i'm not finished yet with my Dockerfile
    my Dockerfile :



    FROM alpine


    RUN apk update
    && apk upgrade
    && apk add nginx php7 php7-fpm php7-opcache php7-gd php7-mysqli php7-zlib php7-curl
    && mkdir /run/nginx
    EXPOSE 80


    From there i start my container :



    docker run -ti -p 80:80 -p 443:442 -v /home/docker/web/conf:/etc/nginx/conf.d/ -v /home/docker/web/www:/var/www/localhost/htdocs test


    I then install certbot-nginx, and start it to generate my certificate, which i copy in my /var/www/localhost/htdocs/example.fr/ to access it from outside the container.
    Finally i start php-fpm7 & nginx.



    My nginx config :



    server {
    server_name example.fr;
    root /var/www/localhost/htdocs/example.fr;
    index index.html index.htm index.php;
    listen [::]:443 ssl;
    server_tokens off;
    # configure php
    location ~ .php$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    include fastcgi.conf;
    index index.html index.htm index.php;
    }

    location ~* .pem {
    deny all;
    }

    ssl_certificate /var/www/localhost/htdocs/example.fr/fullchain.pem;
    ssl_certificate_key /var/www/localhost/htdocs/example.fr/privkey.pem; # managed by Certbot

    }

    server {
    if ($host = example.fr) {
    return 301 https://$host$request_uri;
    }
    # managed by Certbot
    server_name example.fr;
    listen 80;
    listen [::]:80;
    #return 404;
    }


    I'm probably missing something simple but i'm stuck since a week.
    thanks !










    share|improve this question







    New contributor




    idiocrate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I'm new to docker and try to build an image based on Alpine to take care of my websites with HTTPS connexions.
      Currently i'm at the step to make it work from the container so i'm not finished yet with my Dockerfile
      my Dockerfile :



      FROM alpine


      RUN apk update
      && apk upgrade
      && apk add nginx php7 php7-fpm php7-opcache php7-gd php7-mysqli php7-zlib php7-curl
      && mkdir /run/nginx
      EXPOSE 80


      From there i start my container :



      docker run -ti -p 80:80 -p 443:442 -v /home/docker/web/conf:/etc/nginx/conf.d/ -v /home/docker/web/www:/var/www/localhost/htdocs test


      I then install certbot-nginx, and start it to generate my certificate, which i copy in my /var/www/localhost/htdocs/example.fr/ to access it from outside the container.
      Finally i start php-fpm7 & nginx.



      My nginx config :



      server {
      server_name example.fr;
      root /var/www/localhost/htdocs/example.fr;
      index index.html index.htm index.php;
      listen [::]:443 ssl;
      server_tokens off;
      # configure php
      location ~ .php$ {
      fastcgi_pass 127.0.0.1:9000;
      fastcgi_index index.php;
      include fastcgi.conf;
      index index.html index.htm index.php;
      }

      location ~* .pem {
      deny all;
      }

      ssl_certificate /var/www/localhost/htdocs/example.fr/fullchain.pem;
      ssl_certificate_key /var/www/localhost/htdocs/example.fr/privkey.pem; # managed by Certbot

      }

      server {
      if ($host = example.fr) {
      return 301 https://$host$request_uri;
      }
      # managed by Certbot
      server_name example.fr;
      listen 80;
      listen [::]:80;
      #return 404;
      }


      I'm probably missing something simple but i'm stuck since a week.
      thanks !










      share|improve this question







      New contributor




      idiocrate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I'm new to docker and try to build an image based on Alpine to take care of my websites with HTTPS connexions.
      Currently i'm at the step to make it work from the container so i'm not finished yet with my Dockerfile
      my Dockerfile :



      FROM alpine


      RUN apk update
      && apk upgrade
      && apk add nginx php7 php7-fpm php7-opcache php7-gd php7-mysqli php7-zlib php7-curl
      && mkdir /run/nginx
      EXPOSE 80


      From there i start my container :



      docker run -ti -p 80:80 -p 443:442 -v /home/docker/web/conf:/etc/nginx/conf.d/ -v /home/docker/web/www:/var/www/localhost/htdocs test


      I then install certbot-nginx, and start it to generate my certificate, which i copy in my /var/www/localhost/htdocs/example.fr/ to access it from outside the container.
      Finally i start php-fpm7 & nginx.



      My nginx config :



      server {
      server_name example.fr;
      root /var/www/localhost/htdocs/example.fr;
      index index.html index.htm index.php;
      listen [::]:443 ssl;
      server_tokens off;
      # configure php
      location ~ .php$ {
      fastcgi_pass 127.0.0.1:9000;
      fastcgi_index index.php;
      include fastcgi.conf;
      index index.html index.htm index.php;
      }

      location ~* .pem {
      deny all;
      }

      ssl_certificate /var/www/localhost/htdocs/example.fr/fullchain.pem;
      ssl_certificate_key /var/www/localhost/htdocs/example.fr/privkey.pem; # managed by Certbot

      }

      server {
      if ($host = example.fr) {
      return 301 https://$host$request_uri;
      }
      # managed by Certbot
      server_name example.fr;
      listen 80;
      listen [::]:80;
      #return 404;
      }


      I'm probably missing something simple but i'm stuck since a week.
      thanks !







      nginx ssl-certificate docker certbot alpine






      share|improve this question







      New contributor




      idiocrate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      idiocrate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      idiocrate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 11 mins ago









      idiocrateidiocrate

      1




      1




      New contributor




      idiocrate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      idiocrate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      idiocrate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "2"
          };
          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',
          autoActivateHeartbeat: false,
          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
          });


          }
          });






          idiocrate is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f957089%2fcant-turn-ssl-on-a-dockers-nginx-container%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          idiocrate is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          idiocrate is a new contributor. Be nice, and check out our Code of Conduct.













          idiocrate is a new contributor. Be nice, and check out our Code of Conduct.












          idiocrate is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Server Fault!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f957089%2fcant-turn-ssl-on-a-dockers-nginx-container%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

          117736 Шеррод Примітки | Див. також | Посилання | Навігаційне...

          As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

          Маріан Котлеба Зміст Життєпис | Політичні погляди |...