Score:0

PostfixAdmin on Nginx returning 403 Forbidden

co flag

I haven't used PostfixAdmin in a while. When I recently went to mail.domain.com/postfixadmin I was greeted with a message telling me to point an alias to /postfixadmin/public. After a bit of searching online, this is what I changed my Nginx configuration to:

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

    listen 80;
    server_name mail.domain.com;

    include snippets/letsencrypt.conf;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    server_name mail.domain.com;
    root /var/www;
    ssl_certificate /etc/letsencrypt/live/domain.com-0002/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/domain.com-0002/privkey.pem; # managed by Certbot
    ssl_trusted_certificate /etc/letsencrypt/live/domain.com/chain.pem;
    include snippets/ssl.conf;
    include snippets/letsencrypt.conf;

    location / {
        try_files $uri $uri/ /index.php;
    }
    location /postfixadmin {
        alias /var/www/postfixadmin/public;
        try_files $uri $uri/ /index.php;
    }
    location /rspamd {
        proxy_pass http://127.0.0.1:11334;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
    location ~* \.php$ {
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {return 404;}
        fastcgi_pass  unix:/run/php/php7.4-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME 
        $document_root$fastcgi_script_name;
    }
}

Now I get an 403 Forbidden error trying to access PostfixAdmin. I assume my configuration is wrong somewhere?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.