1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00
cowyo/letsencrypt/cowyo.ssl.nginx
Zack Scholl 7e3dd5a83d Updated and renamed
Former-commit-id: b5ac59cb19d2bc8c7a86560aca55250af5f0c13f [formerly 327bf636df25e46bda09fed20352a548d6922e3e] [formerly 207656a9b061ecd5f5def1dd0ef57e7e17d93524 [formerly 8d4d68c840]]
Former-commit-id: e1b78b6df1d5ce2d6d2de334bf2cda9060057558 [formerly a109361bc20bba2b4917e7b174fca02e68642169]
Former-commit-id: 8268b6f2e664d64a308bfcc0593756a96761afc6
2016-03-19 11:31:47 -04:00

51 lines
1.2 KiB
Nginx Configuration File

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/fullchain.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";
}
}