home · contact · privacy
Add SSL config for htwtxt server.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 25 Apr 2016 21:06:14 +0000 (23:06 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 25 Apr 2016 21:06:14 +0000 (23:06 +0200)
systemfiles/nginx.conf

index 601b67bb351a9826ffb1b33da1620a615b666325..0c1efe317218698071baf42ce7bb46767bffcaca 100644 (file)
@@ -23,7 +23,13 @@ http {
        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;
 
        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;
 
-        # IRC logs server
+        # enforce https
+        server {
+                listen 80;
+                return 301 https://$host$request_uri;
+        }
+
+        # IRC logs
         server {
                 listen 443 ssl;
                 server_name dump.plomlompom.com;
         server {
                 listen 443 ssl;
                 server_name dump.plomlompom.com;
@@ -44,7 +50,10 @@ http {
 
         # htwtxt
         server {
 
         # htwtxt
         server {
+                listen 443 ssl;
                 server_name htwtxt.plomlompom.com;
                 server_name htwtxt.plomlompom.com;
+                ssl_certificate /etc/letsencrypt/live/htwtxt.plomlompom.com/fullchain.pem;
+                ssl_certificate_key /etc/letsencrypt/live/htwtxt.plomlompom.com/privkey.pem;
                 location / {
                         proxy_pass http://127.0.0.1:8000;
                 }
                 location / {
                         proxy_pass http://127.0.0.1:8000;
                 }