Spring naar de hoofdinhoud

HAProxy Simple Configuration for local webserver

Parameters for this setup:setup

Local webserver is on ip address 192.168.1.200 and uses port 80

 

Step

1
:
  1. Define a Real server:server

name
    Internal_www,
  • Name: IP:anything you like to recognize the wegserver
  • IP address: The IP address of the internal webserver e.g. 192.168.1.200, port 80, no ssl200
  • Port: 80
  • SSL: disable

afbeelding.pngafbeelding.png

     

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

afbeelding.png

afbeelding.png

  1. Define a condition: Name
      e.g.
    • Name: www,anything you like
    • Condition: Host matches,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.

www.domain.comafbeelding.png

  1. Define a rule: Name redirect_www, Select Conditions: www, HAProxy function: Use specified Backend, pool_www

  2. Define a Virtual Service->Public Service: Name front_443, Listen address: 196.44.xxx.xxx:443 (TAB), enable ssl-offloading, default backend pool: pool_www (TAB), certificate: your Let's Encrypt cert, Advanced settings: Select rules: redirect_ww