0

I already have a web server installed with nginx, and I can access it by visiting https://skwal.net/

I would like to access iRedMail applications under https://skwal.net/mail/(iredadmin for example)

Here is what I tried :

server { 
    listen 8080;
    server_name skwal.net;
    return 301 https://$server_name$request_uri;
}

server {
    listen 8443 ssl;
    server_name skwal.net;

    error_page 503 /maintenance.html;
    
    location /maintenance.html {
        root /home/skwal/skwal-net-v2/extra/;
        internal;
    }

    location /static/ { 
        alias /home/skwal/skwal-net-v2/static/;
    }

    location / {
        if (-f /home/skwal/skwal-net-v2/hooks/maintenance) {
            return 503;
        }
        proxy_pass http://127.0.0.1:8000;
    }

    ssl_certificate /etc/letsencrypt/live/skwal.net/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/skwal.net/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


    location /mail/ {
        proxy_pass http://127.0.0.1:9000;
    }
}

server {
    listen 127.0.0.1:9000;
    server_name _;
    
    root /var/www/html;
        index index.php index.html;
        include /etc/nginx/templates/misc.tmpl;
        include /etc/nginx/templates/ssl.tmpl;
        include /etc/nginx/templates/iredadmin.tmpl;
        include /etc/nginx/templates/roundcube.tmpl;
        include /etc/nginx/templates/sogo.tmpl;
        include /etc/nginx/templates/netdata.tmpl;
        include /etc/nginx/templates/php-catchall.tmpl;
        include /etc/nginx/templates/stub_status.tmpl;
}

I have my own server at home and all incoming requests are redirected to port 8080 or 8443 of my server.

I think this should work but I always get this error :

nginx: [emerg] no port in upstream "php_workers" in /etc/nginx/templates/fastcgi_php.tmpl:13
nginx: configuration file /etc/nginx/nginx.conf test failed
SkwalExe
  • 1
  • 1

0 Answers0