Spring naar de hoofdinhoud

HAProxy Simple Configuration for local webserver

Parameters for this setup

Local webserver is on ip address 192.168.1.200 and uses port 80

Step 1: Define a Real server

  • Name: anything you like to recognize the webserver
  • IP address: The IP address of the internal webserver e.g. 192.168.1.200
  • Port: 80
  • SSL: disable

afbeelding.png

  1. Define a Virtual service->Backend Pool
    • Name: anything you like
    • Servers: The server you defined in the step 1 (remember to press TAB after entering server name) 

afbeelding.png

afbeelding.png

Step 2: Define a condition:

    • Name: anything you like
    • Condition: Host contains or you can use any other condition to match like Host matches and use the full url.
    • Host string = Anything to recognize the URL or the full url in case of host matches.

afbeelding.png

Step 3: Define a rule

  • Name: anything you like
  • Select Conditions: Select the webserver from the dropdown menu
  • Under HAProxy function > Execute function:  Use specified Backend Pool
  • Use backend pool: Select the backend Pool from the drop down menu

afbeelding.png

Step 4: Define a Virtual Service

Under Public Service:

  • Name: anything you like
  • Listen addresses: 0.0.0.0:443 (TAB)
  • Enable SSL offloading: Checked
  • Default backend pool: Select from dropdown menu (TAB)
  • Certificate: your Let's Encrypt certificate
  • Under Advanced settings: 
    • Select rules: The rule you made earlier

afbeelding.png

afbeelding.png