File: //etc/nginx/sites-enabled/akaalcreatives.net
map $http_accept $webp_suffix {
default "";
"~*webp" ".webp";
}
server {
root /home/AkaalCreatives/akaalcreatives.net/web;
index index.html;
server_name akaalcreatives.net www.akaalcreatives.net;
access_log /home/AkaalCreatives/akaalcreatives.net/logs/access.log;
error_log /home/AkaalCreatives/akaalcreatives.net/logs/error.log info;
location ~* ^.+\.(png|jpe?g|gif)$ {
add_header Vary Accept;
try_files $uri$webp_suffix $uri =404;
}
location / {
try_files $uri $uri/ =404;
}
# Global restrictions configuration file.
# Designed to be included in any server {} block.
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
# Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban)
location ~ /\. {
deny all;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
# Cloudflare SSL
listen [::]:443 ssl http2;
listen 443 ssl http2;
ssl_certificate /home/AkaalCreatives/akaalcreatives.net/.ssl/fullchain.pem;
ssl_certificate_key /home/AkaalCreatives/akaalcreatives.net/.ssl/privkey.pem;
}
server {
listen [::]:80;
listen 80;
server_name www.akaalcreatives.net;
return 302 https://$server_name$request_uri;
}
server {
listen [::]:80;
listen 80;
server_name akaalcreatives.net;
return 302 https://www.$server_name$request_uri;
}