Browse Source

fix nginx / certbot

Guilhem Saurel 7 years ago
parent
commit
e751ee7126
2 changed files with 23 additions and 1 deletions
  1. 3 1
      README.md
  2. 20 0
      nginx.conf

+ 3 - 1
README.md

@@ -28,7 +28,6 @@ cd docker-atelier
 
 ## Deploy Services
 
-add `include /etc/nginx/sites-enabled/*` to /etc/nginx/nginx.conf in http section
 
 ```
 export DOMAIN=oxyta.net
@@ -36,10 +35,13 @@ export MAIL=services@$DOMAIN
 export MYSQL_PASSWORD=$(openssl rand -base64 32)
 export MYSQL_ROOT_PASSWORD=$(openssl rand -base64 32)
 
+cp nginx.conf /etc/nginx
+systemctl nginix restart
 for service in pad git cloud
 do
     pushd $service
     ln -s $PWD/nginx.conf /etc/nginx/sites-enabled/$service
+    systemctl restart nginx
     certbot certonly --email $MAIL --webroot -w /srv/letsencrypt/ --agree-tos -d www.$service.$DOMAIN -d $service.$DOMAIN
     docker-compose up -d
     popd

+ 20 - 0
nginx.conf

@@ -0,0 +1,20 @@
+worker_processes  1;
+
+events {
+    worker_connections  1024;
+}
+
+http {
+    include           mime.types;
+    default_type      application/octet-stream;
+    keepalive_timeout 65;
+    sendfile          on;
+    gzip              on;
+    gzip_http_version 1.1;
+    gzip_comp_level   2;
+    gzip_types        text/plain text/html text/css
+                      application/x-javascript text/xml
+                      application/xml application/xml+rss
+                      text/javascript;
+    include           /etc/nginx/sites-enabled/*;
+}