1

我已经在我的服务器上安装了 iRedMail,它可以完美地管理我的电子邮件。我想将此服务器也用作网站服务器。我进入了nginx配置/etc/nginx/sites-enabled/ 00-default-ssl.conf 00-default.conf

当我添加www.mywebsite.com.conf 它似乎没有被渲染。

mywebsite 没有部署,我的 nginx 配置很简单。

它与 iRedAdmin 配置有关吗?因为文件00-default-ssl.conf使用模板。nginx 中的模板是否覆盖了 conf 文件?

我的会议上有什么遗漏吗?

提前致谢 !

内容 00-default-ssl.conf

    server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name mail.mywebsite.com;

    root /var/www/html/iredmail;
    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;  
}

那是我对我的 conf www.mywebsite.conf

server {
        root /var/www/html/mywebsite.com/public/;
        index index.html ;

        server_name site.mywebsite.com;

        location / {
                alias /var/www/blog/html/public;
                index index.html;
        }

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/site.mywebsite.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/site.mywebsite.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

}
4

1 回答 1

1

使用 Nginx,/etc/nginx/sites-available/site.mywebsite.com.confserver{}块中创建另一个 .conf 文件,然后将文件符号链接到文件sites-enabled/夹。

使用不同的 webroot 文件夹,/var/www/html因为在这个文件夹中index.html附加/mail到主机

于 2021-05-04T19:45:26.893 回答