Skip to content

Instantly share code, notes, and snippets.

@hansdg1
Created April 27, 2017 23:44
Show Gist options
  • Save hansdg1/0c54c3578259ce7d37a6b9f0362712b1 to your computer and use it in GitHub Desktop.
Save hansdg1/0c54c3578259ce7d37a6b9f0362712b1 to your computer and use it in GitHub Desktop.
nginx config for blog2.hansguthrie.com
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name blog2.hansguthrie.com www.blog2.hansguthrie.com;
include /etc/nginx/snippets/letsencrypt.conf;
location / {
return 301 https://blog2.hansguthrie.com$request_uri;
}
}
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server ipv6only=on;
server_name www.blog2.hansguthrie.com;
ssl_certificate /etc/letsencrypt/live/blog2.hansguthrie.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/blog2.hansguthrie.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/blog2.hansguthrie.com/fullchain.pem;
include /etc/nginx/snippets/ssl.conf;
root /var/www/blog2.hansguthrie.com;
index index.html;
location / {
try_files $uri $uri/ =404;
#return 301 https://blog2.hansguthrie.com$request_uri;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name blog2.hansguthrie.com;
ssl_certificate /etc/letsencrypt/live/blog2.hansguthrie.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/blog2.hansguthrie.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/blog2.hansguthrie.com/fullchain.pem;
include /etc/nginx/snippets/ssl.conf;
root /var/www/blog2.hansguthrie.com;
index index.html;
location / {
#try_files $uri $uri/ =404;
return 301 https://www.blog2.hansguthrie.com$request_uri;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment