# Reverse Proxy Installation

<div style="text-align: right">Antoine de Barbarin</div>

---



## Certificate

In the **pfSense** web configurator, go to **System > Certificates > Authorities** and click on `Add`, then fill it with the following values and click on `Save`

![image-20250601150743814](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/web-certificate-01.png)



Then go to **Certificates** and click on `Add/Sign` then fill the form with the following values and click on `Save`

![image-20250601151103072](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/web-certificate-02.png)

---



## HAProxy

Go to **System > Package Manager > Available Packages** and search for `HAProxy` and click on `Install`

![image-20250601150147787](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/haproxy-01.png)



Click on `Confirm` to begin the installation

![image-20250601150300998](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/haproxy-02.png)



When the installation is complete, you will have the following result

![image-20250601150429856](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/haproxy-03.png)



Go to **Services > HAProxy > Backend** and click on <img src="https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/pfsense-add-button.png" alt="image-20250601151302432" style="zoom:40%;" />, then fill the form with the following values and click on `Save`

![image-20250601151849403](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/haproxy-04.png)
![image-20250601151927418](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/haproxy-05.png)
![image-20250601152041673](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/haproxy-06.png)



Do the same for **Wiki.js** with the port being `3000` instead of `3456`.

![image-20250601152425585](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/haproxy-07.png)



Then go to **Frontend** and click on <img src="https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/pfsense-add-button.png" alt="Add button" style="zoom:40%;" />, then fill the form with the following values and click on `Save`

![image-20250601153306981](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/haproxy-08.png)



Repeat the process with `Vikunja` checking the option `Shared Frontend` selecting the `Wikijs-Frontend` and click on `Save`

![image-20250601153556929](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/haproxy-09.png)



Then add a third frontend to redirect requests from **HTTP** to **HTTPS** when in the `infrasi.lan` domain

![image-20250601154215170](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/haproxy-10.png)



You should have the following frontends

![image-20250601154325962](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/haproxy-11.png)



Go to **Settings** to enable **HAProxy** filling the form with the following values and click on `Save`

![image-20250601154653757](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/haproxy-12.png)



Go to **Firewall > Rules > WAN** and add a rule to accept `IPv4 TCP` requests on `HTTP` and `HTTPS` ports

![image-20250601155104637](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/haproxy-13.png)



Now the websites are available from the outside using **HTTPS** and the domain name `infrasi.lan`

> ⓘ  You need to have **DNS** entries in the **WAN network** that points to your **WAN address** for the `infrasi.lan` domain and the `notes.infrasi.lan` and `wiki.infrasi.lan` sub-domains.

![image-20250601155938838](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/haproxy-14.png)

![image-20250601160046244](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/scaled-1680-/haproxy-15.png)