← back to Gallery Agentabrams

deploy/gallery.agentabrams.com.ssl.nginx

40 lines

# gallery.agentabrams.com — SSL vhost (installed after the webroot cert exists)
server {
    server_name gallery.agentabrams.com;

    access_log /var/log/nginx/gallery.agentabrams.com.access.log;
    error_log /var/log/nginx/gallery.agentabrams.com.error.log;

    add_header X-Content-Type-Options "nosniff" always;
    add_header Referrer-Policy "strict-origin-when-cross-origin" always;

    root /var/www/gallery.agentabrams.com;
    index index.html;
    autoindex off;

    location ~* \.(mp4|webm|jpg|jpeg|png|webp)$ {
        expires 30d;
        add_header Cache-Control "public, max-age=2592000";
        try_files $uri =404;
    }

    location /.well-known/acme-challenge/ { root /var/www/gallery.agentabrams.com; }

    location / {
        try_files $uri $uri/ $uri.html =404;
    }

    listen 45.61.58.125:443 ssl;
    ssl_certificate /etc/letsencrypt/live/gallery.agentabrams.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/gallery.agentabrams.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

server {
    listen 45.61.58.125:80;
    server_name gallery.agentabrams.com;
    location /.well-known/acme-challenge/ { root /var/www/gallery.agentabrams.com; }
    location / { return 301 https://$host$request_uri; }
}