1

Topic: Change port in nginx

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

We are trying to change from port 443 to let's say 5443 in Nginx. I am not having any success. Could you please provide an an example or direct us to info on the www?
Thanks

----

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

2

Re: Change port in nginx

https://letmegooglethat.com/?q=nginx+change+port

It's a little mean, but come on, you can't tell me you didn't find anything on our own

3

Re: Change port in nginx

I was hoping to find someone with knowledge of iredmail and nginx setup.
Specifically if these directives are to be used and what file they would be placed in.
RequestHeader set "x-webobjects-server-port" "443"
  RequestHeader set "x-webobjects-server-name" "yourhostname"
  RequestHeader set "x-webobjects-server-url" "yourhostname"

or if this should be done differently.

This post refers to Apache sogo.nu/support/faq/how-to-configure-apache-as-frontend.html
Have not been able to find on nginx.

4

Re: Change port in nginx

steggur wrote:

We are trying to change from port 443 to let's say 5443 in Nginx. I am not having any success. Could you please provide an an example or direct us to info on the www?

Change the port number in /etc/nginx/sites-enabled/00-default-ssl.conf.
If you're running some web applications which triggers http -> https redirection, please also change the port number in redirected URL. e.g. /etc/nginx/templates/*.tmpl.

5 (edited by steggur 2023-01-24 20:14:09)

Re: Change port in nginx

ZhangHuangbin wrote:
steggur wrote:

We are trying to change from port 443 to let's say 5443 in Nginx. I am not having any success. Could you please provide an an example or direct us to info on the www?

Change the port number in /etc/nginx/sites-enabled/00-default-ssl.conf.
If you're running some web applications which triggers http -> https redirection, please also change the port number in redirected URL. e.g. /etc/nginx/templates/*.tmpl.

Thank you for the tip.
I did the following:
edit sogo.tmpl
$host;
to
$host:5443;
edit 00-default-ssl.conf
listen 443 ssl http2;
listen [::]:443 ssl http2;
to
listen 5443 ssl http2;
listen [::]:5443 ssl http2;
edit 00-default.conf
$host$request_uri;
to
$host:5443$request_uri;
and
Opened port in firewall.