Skip to content

Instantly share code, notes, and snippets.

@benhg
Created September 11, 2019 18:44
Show Gist options
  • Save benhg/e33ff7963d04a49dc3ad4dca8a374db9 to your computer and use it in GitHub Desktop.
Save benhg/e33ff7963d04a49dc3ad4dca8a374db9 to your computer and use it in GitHub Desktop.
server {
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name HOST;
error_page 404 /custom_404.html;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/HOST/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/datasci.watzek.cloud/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
}
server {
if ($host = HOST) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name HOST;
return 404; # managed by Certbot
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment