Topic: Nginx does not work with coudflare's ssl settings.
I have a DNS domain such as mail.example.com with cloudflare. After installing iRedMail, I changed the SSL settings in the nginx file with cloudflare keys as follows. Before i used this certicate files with apache2 it was working fine.
vim /etc/nginx/templates/ssl.tmpl;
ssl_certificate_key /etc/ssl/example.com/mydomain.com.key; ## cloudflare ssl key
ssl_certificate /etc/ssl/example.com/mydomain.com.pem; ## cloudflare ssl pem
Ssl Works fine with php and html files. I tested it.
But when i try to Access mail.example.com/iredadmin ==> i get this error. (502 gateway)
2024/05/28 09:33:37 [error] 35091#35091: *1 connect() failed (111: Unknown error) while connecting to upstream, client: 172.69.251.151, server: mail.example.com, request: "GET /iredadmin HTTP/2.0", upstream: "uwsgi://127.0.0.1:7791", host: "mail.example.com"
Besides, when i try to Access mail.example.com/ or mail.example.com/mail ==> i get this error. (403 Permission denied)
2024/05/28 09:23:40 [error] 31395#31395: *1 "/opt/www/roundcubemail/index.php" is forbidden (13: Permission denied), client: 172.69.251.131, server: mail.example.com, request: "GET /mail/ HTTP/2.0", host: "mail.example.com"
Here is my nginx server config:
#
# Note: This file must be loaded before other virtual host config files,
#
# HTTPS
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name mail.example.com;
root /var/www/html;
index index.php index.html;
error_log /var/log/nginx/error.log warn;
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;
}
Help please. What i need to do ?
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.