From b97c8bb9452b393c8afc007e0512e8a14bfedb74 Mon Sep 17 00:00:00 2001 From: Zack Date: Sat, 13 Feb 2016 20:22:37 -0500 Subject: [PATCH] Create README.md Former-commit-id: 6ea0d59fccb3fa341ffd0cd90c75672f7cf80ef9 [formerly d4ed70bde4f0ca9c490b0ffa7e5caa09f673f468] [formerly 8867ae8d724359b3f3beab2e6d3039de38de223f [formerly 3296bdb20ebe37fb0747d9b349bdaa95accd2258 [formerly 17c99343fcff78e577ffd287bb65007b82b636b9]]] Former-commit-id: 14bdf63360f7b0f5a958af1dd36fcba9171de4c8 [formerly 661dc438bb508e5367c5c7afd5aa21e42b314997] Former-commit-id: cb37176a827262c5e213d7795b4b9db6c74dc889 Former-commit-id: c137f600225f117c8d2ea3e7c8424d0a2897e511 --- letsencrypt/README.md | 62 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 letsencrypt/README.md diff --git a/letsencrypt/README.md b/letsencrypt/README.md new file mode 100644 index 0000000..307568e --- /dev/null +++ b/letsencrypt/README.md @@ -0,0 +1,62 @@ +To use letsencrypt follow these steps: + +``` +git clone https://github.com/letsencrypt/letsencrypt +cd letsencrypt +sudo ./letsencrypt-auto certonly --standalone --email youremail@somewhere.com -d yourserver.com +``` + +And then replace the NGINX file in `../install` with the following: + +``` +server { + listen 80; + server_name ADDRESS; + rewrite ^ https://$server_name$request_uri? permanent; +} + +server { + # SERVER BLOCK FOR ADDRESS + listen 443 ssl; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_certificate /etc/letsencrypt/live/ADDRESS/cert.pem; + ssl_certificate_key /etc/letsencrypt/live/ADDRESS/privkey.pem; + + access_log /etc/nginx/logs/access-ADDRESS.log; + error_log /etc/nginx/logs/error-ADDRESS.log info; + root CUR_DIR; + server_name ADDRESS; + + # Media: images, icons, video, audio, HTC + location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { + expires 1M; + access_log off; + add_header Cache-Control "public"; + } + + # CSS and Javascript + location ~* \.(?:css|js)$ { + expires 1y; + access_log off; + add_header Cache-Control "public"; + } + + location ^~ /static { + try_files $uri $uri/ =404; + } + + location ~ ^/ { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header X-NginX-Proxy true; + + proxy_pass https://127.0.0.1:PORT; + proxy_redirect off; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } +} +```