server {
    server_name photos.fongaboo.com www.photos.fongaboo.com immich.openkimono.local immich;

    if ($host != 'photos.fongaboo.com') {
        return 301 https://photos.fongaboo.com$request_uri;
    }

    access_log /var/log/nginx/photos_combined_access.log;
    error_log  /var/log/nginx/photos_combined_error.log;

    location / {
        proxy_pass http://localhost:2283;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        client_max_body_size 2G;
    }

    location ~ /\. {
       deny all;
    }

    location ^~ /.well-known/ {
       allow all;
    }

    # if ($request_method !~ ^(GET|HEAD|POST)$ ) {
        # return 405;
    # }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/photos.fongaboo.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/photos.fongaboo.com/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



    add_header Strict-Transport-Security "max-age=31536000" always; # managed by Certbot

}
server {
    if ($host = www.photos.fongaboo.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = photos.fongaboo.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80;
    server_name photos.fongaboo.com www.photos.fongaboo.com immich.openkimono.local immich;

    if ($host != 'photos.fongaboo.com') {
        return 301 https://photos.fongaboo.com$request_uri;
    }

    access_log /var/log/nginx/photos_combined_access.log;
    error_log  /var/log/nginx/photos_combined_error.log;

    location / {
        proxy_pass http://localhost:2283;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        client_max_body_size 2G;
    }

    # if ($request_method !~ ^(GET|HEAD|POST)$ ) {
        # return 405;
    # }







}