0

basically I have a raspberry pi with multiple webserver daemons on different ports, to be specific lighttpd, apache, and the ADAFruit WebIDE. Basically here are the ways i need it to work[how would you best write the config file?]:

http://RasberryPi:80/ > http://localhost:8080/
https://RasberryPi:443/ > http://localhost:8080/
(or if it cant be done as root folder to be /apache)

http://RaspberryPi:80/WebIDE > http://localhost:8081/
https://RasberryPi:443/WebIDE > http://localhost:8081/

http://RasberryPi:80/lighttp > http://localhost:8082/
https://RasberryPi:443/lighttp > http://localhost:8082/

i know it should be something like what follows, but what if i dont want load balancing? and i do want https even if the destination server doesnt support it?:

frontend http-in
    bind 10.254.23.225:80
    acl has_special_uri path_beg /special
    use_backend special_server if has_special_uri
    default_backend webfarm

backend webfarm
    balance roundrobin
    cookie SERVERID insert
    option httpchk HEAD /check.txt HTTP/1.0
    option httpclose
    option forwardfor
    server webA 10.254.23.4:80 cookie webA check
    server webB 10.248.23.128:80 cookie webB check

backend special_server
    balance roundrobin
    cookie SERVERID insert
    option httpchk HEAD /check.txt HTTP/1.0
    option httpclose
    option forwardfor
    server webC 10.0.0.1:80 cookie webC check

1 Answers1

0

You are basically almost there. Configure three backends:

  1. apache, with only the server localhost:8080
  2. lighttpd, with server localhost:8082
  3. webide, with server localhost:8081

Make apache your default backend. Add acls to use the other backends if the URI starts with the appropriate path.

Felix Frank
  • 3,063
  • 1
  • 15
  • 22