Skip to content

Instantly share code, notes, and snippets.

@lightalloy
Created September 26, 2018 13:49
Show Gist options
  • Save lightalloy/570f072433cd1ded8f9ca964287fcd99 to your computer and use it in GitHub Desktop.
Save lightalloy/570f072433cd1ded8f9ca964287fcd99 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name www.litealloy.ru;
return 301 https://litealloy.ru$request_uri;
}
server {
listen 97.107.136.107:80; # default_server;
listen [::]:80; # default_server;
server_name litealloy.ru;
server_tokens off;
root /home/light/sites/litealloy_ru/current;
index index.html;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.html;
}
# return 301 https://litealloy.ru$request_uri;
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/litealloy.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/litealloy.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
if ($scheme != "https") {
return 301 https://$host$request_uri;
} # managed by Certbot
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment