Default Nginx Config
server {
listen 80;
listen [::]:80;
server_name site.com www.site.com;
access_log /home/sitecom/logs/access_log;
error_log /home/sitecom/logs/error_log;
return 301 https://$server_name$request_uri;
}
server {
listen 443;
listen [::]:443;
ssl on;
ssl_certificate /etc/letsencrypt/live/site.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/site.com/privkey.pem;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
autoindex off;
server_name site.com www.site.com;
root /home/sitecom/www;
index index.html index.php;
access_log /home/sitecom/logs/access_log;
error_log /home/sitecom/logs/error_log;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root:/tmp";
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
}