Topic: Another Nginx reverse proxy question
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.4.2
- Deployed with iRedMail Easy or the downloadable installer? Installer
- Linux/BSD distribution name and version: Ubuntu server 18.04 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- 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.
====
I did quite a bit of searching on what I need, and found some broken links, so thought I would ask. I have iRedMail up and running fine, no issues at all.
I was hoping I could setup a reverse proxy server block in the Nginx config. I have another server that hosts a CCTV interface (shinobi) and was hoping I could reverse proxy to it from Nginx, so I only need to port forward to the iRedMail host.
From what I gathered on my searches, it appears I just need to add a server block to the nginx config, with something like this:
server {
listen 443 ssl;
server_name mail.mydomain.com/cctv;
location /cctv {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://192.168.1.245:8080;
}
I think a proxy.conf may be needed as well.
Do we add this server block to the 00-default-ssl.conf, or do I create a new .conf file and place it in the sites-available and Nginx will pick it up? One user posted a link to another site giving the detail settings of reverse proxy, but the link went to some malware redirect, so I came to a dead end. Any advice or where I can look for examples would be a huge help. Most of my load balancer/reverse proxy experience is with kemp appliances, so I am pretty green with Nginx. Thanks in advance, I have no errors to provide as iRedMail is working flawlessly.
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.