Bachelor Tech
  • Home
  • Tutorials
  • Portfolio
  • About Jan
  • Contact Jan

HAProxy Set Up – SSL termination (OPNSense)

by Jan Bachelor October 31, 2024
  • Sources:
    • Video guide from TheMaw Tech
  • This guide covers set up on OPNSense. We will need to open traffic for nginx web server, so that we can reach the admin web interface + RoundCube, both installed on the iRedMail server.
  • If you do not have haproxy installed on your OPNSense instance, you can install it under System → Firmware → Packages – find os-haproxy and click on the + symbol to install it.
OPNSense – HAProxy Plugin Installation
  • Under Services → HaProxy → Settings, go to Real Servers → Real Servers and add a new host. In this guide, we will use port 8082 that will be forwarded internally on the LAN to the iRedMail VM.
OPNSense – HAProxy – Real Servers
  • Make sure the ‘Enabled’ tick box is ticked.
  • Now go to Virtual Services → Backend pools and add a new host there:
OPNSense – HAProxy – Backend Pool
  • Let’s define a condition. Go to Rules & Checks → Conditions and create a new condition:
    • Condition type: Host amatches
    • Host String: mail.your-domain.tld
OPNSense – HAProxy – Create Condition
  • Now we can set up a rule what to do if the condition is met. Go to Rules & Checks → Rules and create a new rule:
OPNSense – HAProxy – Create a Rule
  • In the rule, we say that if the condition is met, traffic should be forwarded to the backend host we have created. Yet there is no service listening in the front-end yet to handle the traffic.
  • Go to Virtual Services → Public Services and unless you have a service there already, add a new one that listens on port 80.
OPNSense – HAProxy – Set up Front-end
  • Once done, click on the ‘Test syntax’ button and only click on ‘Apply’ if everything is okay.
    • Verify the HAProxy log in case you encouter issues (or post below this article ideally with a screenshot of your set up).
Get SSL Certificate on OPNSense for Web Services (CloudFlare)
Services To Be Installed On Our Mail Server (OPTIONAL)
Go back to course overview: Install iRedMail Mail Server As Proxmox VM With OPNSense As Firewall

Leave a Comment Cancel Reply

Save my name, email, and website in this browser for the next time I comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 FacebookWhatsappEmail

Course Steps

  1. Starting Point and Considerations
  2. Pointing Your MX Records (DNS)
  3. Generic VM Installation (Proxmox)
  4. Firewall - static DHCP assignment (OPNsense)
  5. Firewall - Ports to open on your firewall (OPNSense)
  6. Fiirewall- Set Up NAT Rules (OPNSense)
  7. Dynamic DNS for our ‘mail’ DNS record (CloudFlare with OPNSense)
  8. Get SSL Certificate on OPNSense for Web Services (CloudFlare)
  9. HAProxy Set Up - SSL termination (OPNSense)
  10. Services To Be Installed On Our Mail Server (OPTIONAL)
  11. iRedMail installation (Debian)
  12. Nginx Configuration (Debian)
  13. Access iRedAdmin
  14. Configure Roundcube
  15. CertBot Certificate Creation
  16. Apply Certificates - Nginx
  17. A Theory Crash Course On Postfix (OPTIONAL)
  18. Securing Your Mail Server (Postfix)
  19. SMTP Relay With Brevo
  20. Testing your outgoing email ranking
  21. Connect Your Device To The Mail Server Via Email Client
Previous Next

Recent Comments

  • Jan Bachelor on Dynamic DNS Set Up with DuckDNS on OPNSenseHi Jake, that's awesome, congratulations on getting…
  • Jake on Dynamic DNS Set Up with DuckDNS on OPNSensefollowed guide above to the T and all is working. i…
  • Fastbrain on Dynamic DNS Set Up with DuckDNS on OPNSenseThanks for the guide. For some reason, after follow…

Other courses

Install iRedMail Mail Server As Proxmox VM With...

October 31, 2024

Remote Bucket Storage for Proxmox VM Backups

August 16, 2024

Concur Alternative: Import Employees’ Credit Card Expenses to...

January 19, 2024

Create an automated Gravity workflow that will allow...

January 19, 2024

Dynamically Populate Gravity Forms from Google Sheets (GSheets...

March 16, 2021
Bachelor Tech
  • Home
  • Tutorials
  • Portfolio
  • About Jan
  • Contact Jan

Recent Posts

  • How to join two Proxmox nodes into a cluster (PVE 8.x)

  • How to Rename a Proxmox Node

  • How to mount an NFS share on an Android box

Facebook Twitter Instagram Pinterest Linkedin Youtube

All Rights Reserved. The theme was customized from Soledad, see PenciDesign