1

Topic: Change ssl port 443 to 4443

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.0
- Deployed with iRedMail Easy or the downloadable installer? downloadable
- Linux/BSD distribution name and version: debian 10
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): ldap
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hi, i installed and manage roundcube / iredmail correctly with my ip (example 10.0.0.100 mail.mydomain.com) on 80/443 port
I want change ssl port with 4443
I've changed virtual host on nginx ( etc/nginx/site-avaible/00default-ssl.conf) but not working
If i replace original port working good



What's wrong?
Thanks Spaurlez

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Change ssl port 443 to 4443

Why do you want to change this? Did you open Port 4443 in the firewall?

3

Re: Change ssl port 443 to 4443

Cthulhu wrote:

Why do you want to change this? Did you open Port 4443 in the firewall?

Yes, i've just open 4443 port in the firewall.. i want change because i'm hosting a web server that also listen 80/443 ports and i need another port

4 (edited by Neutro 2020-02-06 08:18:26)

Re: Change ssl port 443 to 4443

/etc/nginx/sites-available/00-default.conf

#
# Note: This file must be loaded before other virtual host config files,
#
# HTTP
server {
    # Listen on ipv4
    listen 80;

    # Listen on ipv6.
    # Note: this setting listens on both ipv4 and ipv6 with Nginx release
    #       shipped in some Linux/BSD distributions.
    #listen [::]:80;

    server_name _;

    # Redirect all insecure http:// requests to https://
    return 301 https://$host$request_uri;
}

/etc/nginx/sites-available/00-default-ssl.conf

#
# Note: This file must be loaded before other virtual host config files,
#
# HTTPS
server {
    listen 4443 ssl;
    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;
}

systemctl restart nginx

Access your site through https://<yourdomain>:4443

If your firewall is enabled, try to disable it if it doesn't work:

systemctl stop nftables

5

Re: Change ssl port 443 to 4443

Thanks for your suggest but i've just tried before write into the forum
i just change port 4443 on 00-default-ssl.conf and restart ngix
firewall is disabled
PS: if i re-change 4443 to 443 is working!! i don't know why!




i've just made this operation with another server like nextcloud (443 to 8443) and with is working!

sad any ideas?

Neutro wrote:

/etc/nginx/sites-available/00-default.conf

#
# Note: This file must be loaded before other virtual host config files,
#
# HTTP
server {
    # Listen on ipv4
    listen 80;

    # Listen on ipv6.
    # Note: this setting listens on both ipv4 and ipv6 with Nginx release
    #       shipped in some Linux/BSD distributions.
    #listen [::]:80;

    server_name _;

    # Redirect all insecure http:// requests to https://
    return 301 https://$host$request_uri;
}

/etc/nginx/sites-available/00-default-ssl.conf

#
# Note: This file must be loaded before other virtual host config files,
#
# HTTPS
server {
    listen 4443 ssl;
    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;
}

systemctl restart nginx

Access your site through https://<yourdomain>:4443

If your firewall is enabled, try to disable it if it doesn't work:

systemctl stop nftables

6

Re: Change ssl port 443 to 4443

maybe there are a problem with redirect page?
if i use https://myserver on port 443 this is a redirect to https://myserver/mail/

if use https://myserverv on 4443 the redirect is wrong and https://myserver:4443 not working  (i think it shoud be https://myserver:4443/mail/


:confused:

Neutro wrote:

/etc/nginx/sites-available/00-default.conf

#
# Note: This file must be loaded before other virtual host config files,
#
# HTTP
server {
    # Listen on ipv4
    listen 80;

    # Listen on ipv6.
    # Note: this setting listens on both ipv4 and ipv6 with Nginx release
    #       shipped in some Linux/BSD distributions.
    #listen [::]:80;

    server_name _;

    # Redirect all insecure http:// requests to https://
    return 301 https://$host$request_uri;
}

/etc/nginx/sites-available/00-default-ssl.conf

#
# Note: This file must be loaded before other virtual host config files,
#
# HTTPS
server {
    listen 4443 ssl;
    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;
}

systemctl restart nginx

Access your site through https://<yourdomain>:4443

If your firewall is enabled, try to disable it if it doesn't work:

systemctl stop nftables

7

Re: Change ssl port 443 to 4443

learningsparulez wrote:

if use https://myserverv on 4443 the redirect is wrong and https://myserver:4443 not working  (i think it shoud be https://myserver:4443/mail/

If https://myserver:4443 is not working, any related error in Nginx log file (/var/log/nginx/*)?