Skip to content

Instantly share code, notes, and snippets.

@thesabbir
Created May 15, 2016 13:14
Show Gist options
  • Save thesabbir/39045d9d8fbf8446c7ed733c2a130062 to your computer and use it in GitHub Desktop.
Save thesabbir/39045d9d8fbf8446c7ed733c2a130062 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name localhost;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
root /srv/build;
index index.html index.htm;
#SSL
server_name localhost;
ssl_certificate /etc/letsencrypt/live/localhost/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/localhost/privkey.pem;
#GZIP
gzip on;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;
gzip_min_length 1000;
location / {
add_header 'Access-Control-Allow-Origin' '*';
try_files $uri $uri/ =404;
}
location ^~ /.well-known {
allow all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment