server {
    listen                  443 ssl;
    listen                  [::]:443 ssl;
    http2                   on;
    server_name             example.com;
    root /var/www/wordpress;

    # SSL
	ssl_protocols          TLSv1.2 TLSv1.3;
    ssl_certificate         /localhost.crt;
    ssl_certificate_key     /localhost.key;

    # logging
    access_log              /var/log/nginx/access.log combined buffer=512k flush=1m;
    error_log               /var/log/nginx/error.log warn;

    index index.php;

    error_page 404 /index.php;

    location ~ [^/]\.php(/|$) { 
        try_files $uri =404;
        fastcgi_pass wordpress:9000;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    location = /adminer/index.php {
        root /var/www;
        fastcgi_pass adminer:9001;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    location /site {
        proxy_pass http://site:3000;
    }

    location /mailhog {
        proxy_pass http://mailhog:8025;
    }
}
