sozu-proxy / sozu

Sōzu HTTP reverse proxy, configurable at runtime, fast and safe, built in Rust. It is awesome!
https://www.sozu.io/
GNU Affero General Public License v3.0
3.12k stars 193 forks source link

Initial Start with Sozu with Docker #1129

Closed shoutmarble closed 2 months ago

shoutmarble commented 3 months ago

I packaged the sozu binary into my own docker-compose.yml. I made using this repository to a Dockerfile and docker-compose.yml.

I then did a quick http to https redirect using my own ACME certificates in my sozu docker-compose.yml.

I'm using sozu from within Docker so I made a quick demo sozu startup repository.

I figured out the cluster terminology (which wasn't present in the default config.toml).

I look forward to figuring Sozu in place of HAproxy and Caddy with the L4 TCP plugins.

My next goal is to try to run live-kit using sozu instead of caddy-L4 using this example.

I'm going to try to replicate livekit-meet-docker using sozu.

I'm pretty sure that sozu-proxy can do everything HAproxy and Caddy with L4 can do.

If you know this isn't possible, please let me know. I just stated my fork of livekit-meet-docker using sozu.

FlorentinDUBOIS commented 3 months ago

Hello :wave:, I am glad you use Sōzu, to me there is no specific restriction. Let me know, if you have an issue with it.

shoutmarble commented 2 months ago

Hi @FlorentinDUBOIS, I believe I put myself in a corner in the way I defined my custom Docker Network Bridge.

I get into this corner with either network_mode: host or network_mode: bridge in my Docker compose.yml

I'm doing something funky with the Docker Bridge Network that sozu doesn't like.

sozu config.toml

saved_state = "/var/lib/sozu/state.json"
# automatic_state_save = false
# logging verbosity. "error", "warn", "info", "debug" and "trace".
log_level = "info"
log_target = "stdout"
# access_logs_target = "file:///var/log/sozu-access.log"
command_socket = "/run/sozu/sozu.sock"
command_buffer_size = 163_840
max_command_buffer_size = 1_638_400
worker_count = 2
worker_automatic_restart = true
handle_process_affinity = false
max_connections = 10_000
max_buffers = 20_000
# min_buffers = 1
buffer_size = 16_393
# ctl_command_timeout = 1000
pid_file_path = "/run/sozu/sozu.pid"
front_timeout = 900
back_timeout = 900
connect_timeout = 3
request_timeout = 180
zombie_check_interval = 1800
activate_listeners = true

#########################################

[clusters]

#########################################

[clusters.whoami]
protocol = "http"
# send_proxy = true
https_redirect = true

frontends = [
    { address = "192.168.100.100:8080", hostname = "who.example.com" },
  { address = "192.168.100.100:8443", hostname = "who.example.com", certificate = "/certs/server.crt", key = "/certs/server.key", certificate_chain = "/certs/server.pem", tls_versions = ["TLS_V12", "TLS_V13"] }
  # { address = "192.168.100.100:8443", hostname = "who.example.com", certificate = "/certs/server.crt", key = "/certs/server.key", certificate_chain = "/certs/server.pem" }
]

backends  = [
    { address = "192.168.100.220:8080" }
]

################################################################
################################################################

[[listeners]]
address = "192.168.100.100:8080"
protocol = "http"

################################################################

[[listeners]]
address = "192.168.100.100:80"
protocol = "http"

################################################################

[[listeners]]
protocol = "https"
address = "192.168.100.100:443"

tls_versions = ["TLS_V12", "TLS_V13"]

cipher_list = [
  # TLS 1.3 cipher suites
  "TLS13_AES_256_GCM_SHA384",
  "TLS13_AES_128_GCM_SHA256",
  "TLS13_CHACHA20_POLY1305_SHA256",
  # TLS 1.2 cipher suites
  "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
  "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
  "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256",
  "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
  "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
  "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
]

################################################################

[[listeners]]
protocol = "https"
address = "192.168.100.100:8443"

tls_versions = ["TLS_V12", "TLS_V13"]

cipher_list = [
  # TLS 1.3 cipher suites
  "TLS13_AES_256_GCM_SHA384",
  "TLS13_AES_128_GCM_SHA256",
  "TLS13_CHACHA20_POLY1305_SHA256",
  # TLS 1.2 cipher suites
  "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
  "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
  "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256",
  "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
  "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
  "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
]

Docker compose.yml

networks:
  sozu-network:
    name: "sozu-network"
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: "192.168.100.0/24"
          gateway: "192.168.100.1"

services:
  sozu:
    container_name: sozu
    hostname: sozu
    domainname: example.com
    image: soz/soz:123
    build:
      context: .
      dockerfile: ubuntu-sozu-docker
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
      - "8443:8443"
    # network_mode: host
    networks:
      sozu-network:
        ipv4_address: 192.168.100.100
    volumes:
      - ./config.toml:/etc/sozu/config.toml
      - ./certificates/example.com.crt:/certs/server.crt:ro
      - ./certificates/example.com.key:/certs/server.key:ro
      - ./certificates/example.com.pem:/certs/server.pem:ro

  whoami:
    image: traefik/whoami
    container_name: who.example.com
    hostname: who.example.com
    domainname: who.example.com
    # ports:
        # - "80:80"
        # - "8082:8082"
    networks:
      sozu-network:
        ipv4_address: 192.168.100.220
    command:
       - --port=8080
       - --name=who.example.com
    volumes:
      - ./certificates/example.com.crt:/certs/server.crt:ro
      - ./certificates/example.com.key:/certs/server.key:ro
      - ./certificates/example.com.pem:/certs/server.pem:ro

Dockerized sozu ubuntu-sozu-docker

FROM ubuntu:latest

EXPOSE 80
EXPOSE 443

RUN mkdir -p /usr/local/bin
RUN mkdir -p /etc/sozu

RUN mkdir -p /var/lib/sozu/
RUN mkdir -p /run/sozu/

COPY ./sozu /usr/local/bin/
COPY ./config.toml /etc/sozu/

ENTRYPOINT ["/usr/local/bin/sozu"]
CMD ["start", "-c", "/etc/sozu/config.toml"]

🟒curl -L -v https://who.example.com:8443/

root@server:~/stalwart# curl -L -v https://who.example.com:8443/
* Host who.example.com:8443 was resolved.
* IPv6: 9999:9999:10:e8ad::1  #<--- My VPS IPv4
* IPv4: 999.999.99.999  #<--- My VPS IPv6
*   Trying [9999:9999:10:e8ad::1]:8443...  #<--- My VPS IPv4
* Connected to who.example.com (9999:9999:10:e8ad::1) port 8443  #<--- My VPS IPv4
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / X25519 / RSASSA-PSS
* ALPN: server accepted http/1.1
* Server certificate:
*  subject: CN=example.com
*  start date: Aug  7 00:39:59 2024 GMT
*  expire date: Nov  5 00:39:58 2024 GMT
*  subjectAltName: host "who.example.com" matched cert's "*.example.com"
*  issuer: C=US; O=Let's Encrypt; CN=R10
*  SSL certificate verify ok.
*   Certificate level 0: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
*   Certificate level 1: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
*   Certificate level 2: Public key type RSA (4096/152 Bits/secBits), signed using sha256WithRSAEncryption
* using HTTP/1.x
> GET / HTTP/1.1
> Host: who.example.com:8443
> User-Agent: curl/8.5.0
> Accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
< HTTP/1.1 200 OK
< Date: Tue, 27 Aug 2024 05:09:25 GMT
< Content-Length: 402
< Content-Type: text/plain; charset=utf-8
< Sozu-Id: 01J693T86QX6SKBZ48XEJ7MK3P
<
Name: who.example.com
Hostname: who.example.com
IP: 127.0.0.1
IP: ::1
IP: 192.168.100.220
RemoteAddr: 192.168.100.100:44142
GET / HTTP/1.1
Host: who.example.com:8443
User-Agent: curl/8.5.0
Accept: */*
Forwarded: proto=https;for=192.168.100.1:38088;by=192.168.100.100
Sozu-Id: 01J693T86QX6SKBZ48XEJ7MK3P
X-Forwarded-For: 192.168.100.1
X-Forwarded-Port: 8443
X-Forwarded-Proto: https

* Connection #0 to host who.example.com left intact
root@server:~/stalwart#

🟒 sozu log successful pull of https://who.example.com:8443/

sozu                | 2024-08-27T05:09:25.378391Z 1724735365378391332 6 INFO-ACCESS  WRK-00     [01J693T86QX6SKBZ48XEJ7MK3P whoami whoami-0-192.168.100.220:8080] 192.168.100.1:38088 192.168.100.220:8080 43ms/2061ΞΌs/489ΞΌs/154ΞΌs/114ΞΌs 86 557 [user-agent=curl/8.5.0] HTTPS-TLS1.3 who.example.com:8443 GET / 200

πŸ”΄sozu redirect to HTTP-to-HTTPS-fail curl -L -v http://who.example.com:8080/

root@server:~/stalwart# curl -L -v http://who.example.com:8080/
* Host who.example.com:8080 was resolved.
* IPv6: 9999:9999:10:e8ad::1  #<--- My VPS IPv4
* IPv4: 999.999.99.999  #<--- My VPS IPv6
*   Trying [9999:9999:10:e8ad::1]:8080...  #<--- My VPS IPv4
* Connected to who.example.com (9999:9999:10:e8ad::1) port 8080
> GET / HTTP/1.1
> Host: who.example.com:8080
> User-Agent: curl/8.5.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Location: https://who.example.com:8080/
< Connection: close
< Content-Length: 0
< Sozu-Id: 01J693Y8AYJ90Z4ZAYXYBCNDAJ
<
* Closing connection
* Clear auth, redirects scheme from HTTP to https
* Issue another request to this URL: 'https://who.example.com:8080/'
* Hostname who.example.com was found in DNS cache
*   Trying [9999:9999:10:e8ad::1]:8080...  #<--- My VPS IPv4
* Connected to who.example.com (9999:9999:10:e8ad::1) port 8080  #<--- My VPS IPv4
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* OpenSSL/3.0.13: error:0A00010B:SSL routines::wrong version number
* Closing connection
curl: (35) OpenSSL/3.0.13: error:0A00010B:SSL routines::wrong version number
root@server:~/stalwart#

πŸ”΄ sozu log fail redirect pull of http://who.example.com:8080/

sozu                | 2024-08-27T05:11:36.542648Z 1724735496542648976 6 ERROR WRK-00    KAWA-H1 [01J693Y8AYJ90Z4ZAYXYBCNDAJ - -]        Session(public=192.168.100.100:8080, session=192.168.100.1:48592, frontend=8, readiness=I("-WEH")&R("-W--")=M("-W--"), backend=<none>, readiness=I("--EH")&R("----")=M("----"))        >>> Error connecting to backend: failed to retrieve the cluster: unauthorized route
sozu                | 2024-08-27T05:11:36.542738Z 1724735496542738001 6 INFO-ACCESS  WRK-00     [01J693Y8AYJ90Z4ZAYXYBCNDAJ - -] 192.168.100.1:48592 - 296ΞΌs/192ΞΌs/-/37ΞΌs/- 86 153 [user-agent=curl/8.5.0] HTTP who.example.com:8080 GET / 301
sozu                | 2024-08-27T05:11:36.546938Z 1724735496546938489 6 WARN  WRK-00    KAWA-H1 [01J693Y8AZ8BH4QWM0K8NGKVKZ - -]        Session(public=192.168.100.100:8080, session=192.168.100.1:48602, frontend=8, readiness=I("R-EH")&R("-W--")=M("----"), backend=<none>, readiness=I("----")&R("----")=M("----"))        >>> Parsing request error in StatusLine: [0, 0, 0, 517] => | | | 16 03 01 02 00 01 00 01 FC 03 03 6A 3C 20 42 E3 ... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
sozu                | 2024-08-27T05:11:36.547104Z 1724735496547104908 6 INFO-ACCESS  WRK-00     [01J693Y8AZ8BH4QWM0K8NGKVKZ - -] 192.168.100.1:48602 - 3344ΞΌs/217ΞΌs/-/89ΞΌs/- 517 1255 [] HTTP - - - 400

🟒Direct CURL of http://192.168.100.220:8080/ with no sozu listener

root@server:~/stalwart# curl -L -v http://192.168.100.220:8080/
*   Trying 192.168.100.220:8080...
* Connected to 192.168.100.220 (192.168.100.220) port 8080
> GET / HTTP/1.1
> Host: 192.168.100.220:8080
> User-Agent: curl/8.5.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 27 Aug 2024 05:19:30 GMT
< Content-Length: 211
< Content-Type: text/plain; charset=utf-8
<
Name: who.example.com
Hostname: who.example.com
IP: 127.0.0.1
IP: ::1
IP: 192.168.100.220
RemoteAddr: 192.168.100.1:47810
GET / HTTP/1.1
Host: 192.168.100.220:8080
User-Agent: curl/8.5.0
Accept: */*

* Connection #0 to host 192.168.100.220 left intact
root@server:~/stalwart#

sozu bootup appears correct

root@server:~/stalwart/scratch# docker compose up
[+] Running 5/5
 βœ” whoami Pulled                                                                                                                   2.1s 
   βœ” 0b8c4591162f Pull complete                                                                                                    0.7s 
   βœ” 733db08f86a6 Pull complete                                                                                                    0.8s 
   βœ” a5d67c72e18d Pull complete                                                                                                    0.9s 
 ! sozu Warning             pull access denied for soz/soz, repository does not exist or may require 'docker logi...               0.9s 
[+] Building 0.8s (13/13) FINISHED                                                                                       docker:default
 => [sozu internal] load build definition from ubuntu-sozu-docker                                                                  0.1s
 => => transferring dockerfile: 311B                                                                                               0.0s
 => [sozu internal] load metadata for docker.io/library/ubuntu:latest                                                              0.6s
 => [sozu internal] load .dockerignore                                                                                             0.0s
 => => transferring context: 2B                                                                                                    0.0s
 => [sozu internal] load build context                                                                                             0.0s
 => => transferring context: 59B                                                                                                   0.0s
 => [sozu 1/7] FROM docker.io/library/ubuntu:latest@sha256:8a37d68f4f73ebf3d4efafbcf66379bf3728902a8038616808f04e34a9ab63ee        0.0s
 => CACHED [sozu 2/7] RUN mkdir -p /usr/local/bin                                                                                  0.0s
 => CACHED [sozu 3/7] RUN mkdir -p /etc/sozu                                                                                       0.0s
 => CACHED [sozu 4/7] RUN mkdir -p /var/lib/sozu/                                                                                  0.0s
 => CACHED [sozu 5/7] RUN mkdir -p /run/sozu/                                                                                      0.0s
 => CACHED [sozu 6/7] COPY ./sozu /usr/local/bin/                                                                                  0.0s
 => CACHED [sozu 7/7] COPY ./config.toml /etc/sozu/                                                                                0.0s
 => [sozu] exporting to image                                                                                                      0.0s
 => => exporting layers                                                                                                            0.0s
 => => writing image sha256:bb6ab8285f8ec02c8e0af650e9cb641f98230303acbbb1045bebc4fbfd525c13                                       0.0s
 => => naming to docker.io/soz/soz:123                                                                                             0.0s
 => [sozu] resolving provenance for metadata file                                                                                  0.0s
[+] Running 3/3
 βœ” Network sozu-network  Created                                                                                                   0.1s 
 βœ” Container sozu        Created                                                                                                   0.1s 
 βœ” Container whoami      Created                                                                                                   0.1s 
Attaching to sozu, whoami
whoami  | 2024/08/28 16:41:38 Starting up on port 8080
sozu    | Logs will be sent to stdout
sozu    | Access logs will be sent to None
sozu    | 2024-08-28T16:41:38.688219Z 1724863298688219138 1 INFO  MAIN  Starting up
sozu    | 2024-08-28T16:41:38.692601Z 1724863298692601210 1 INFO  MAIN  Updating process limits
sozu    | 2024-08-28T16:41:38.693617Z 1724863298693617362 1 INFO  MAIN  Creating command hub
sozu    | 2024-08-28T16:41:38.694432Z 1724863298694432141 1 INFO  MAIN  Launching workers
sozu    | writing 0 in the temp file
sozu    | 2024-08-28T16:41:38.702161Z 1724863298702161661 1 INFO  MAIN  launching worker 0
sozu    | 2024-08-28T16:41:38.703175Z 1724863298703175438 1 INFO  MAIN  launching worker 0 with pid 7
sozu    | 2024-08-28T16:41:38.704211Z 1724863298704211566 1 INFO  MAIN  sending listeners to new worker: Listeners { http: [], tls: [], tcp: [] }
sozu    | 2024-08-28T16:41:38.705671Z 1724863298705671980 1 INFO  MAIN  sent listeners from main: Ok(())
sozu    | writing 0 in the temp file
sozu    | Logs will be sent to stdout
sozu    | Access logs will be sent to None
sozu    | 2024-08-28T16:41:38.710775Z 1724863298710775830 7 INFO  WRK-00        worker 0 starting...
sozu    | 2024-08-28T16:41:38.711711Z 1724863298711711792 1 INFO  MAIN  launching worker 1
sozu    | 2024-08-28T16:41:38.712085Z 1724863298712085795 1 INFO  MAIN  launching worker 1 with pid 8
sozu    | 2024-08-28T16:41:38.712413Z 1724863298712413562 1 INFO  MAIN  sending listeners to new worker: Listeners { http: [], tls: [], tcp: [] }
sozu    | 2024-08-28T16:41:38.712439Z 1724863298712439840 1 INFO  MAIN  sent listeners from main: Ok(())
sozu    | 2024-08-28T16:41:38.712480Z 1724863298712480495 1 INFO  MAIN  Load static configuration
sozu    | 2024-08-28T16:41:38.713048Z 1724863298713048326 1 INFO  MAIN  reloading static configuration
sozu    | 2024-08-28T16:41:38.714156Z 1724863298714156308 1 INFO  MAIN  Reloading static configuration at path /etc/sozu/config.toml    
sozu    | Logs will be sent to stdout
sozu    | Access logs will be sent to None
sozu    | 2024-08-28T16:41:38.715582Z 1724863298715582067 8 INFO  WRK-01        worker 1 starting...
sozu    | 2024-08-28T16:41:38.727932Z 1724863298727932422 1 INFO  MAIN  loading state at path /var/lib/sozu/state.json
sozu    | 2024-08-28T16:41:38.727987Z 1724863298727987264 1 INFO  MAIN  Parsing state file from /var/lib/sozu/state.json...
sozu    | 2024-08-28T16:41:38.728186Z 1724863298728186353 1 INFO  MAIN  Applying state file...
sozu    | 2024-08-28T16:41:38.729218Z 1724863298729218153 1 INFO  MAIN  Successfully loaded state from path /var/lib/sozu/state.json, 0 ok messages, 0 errors
sozu    | 2024-08-28T16:41:38.731760Z 1724863298731760420 7 INFO  WRK-00        will try to receive listeners
sozu    | 2024-08-28T16:41:38.732193Z 1724863298732193242 7 INFO  WRK-00        received listeners: Listeners { http: [], tls: [], tcp: [] }
sozu    | 2024-08-28T16:41:38.732207Z 1724863298732207918 7 INFO  WRK-00        starting event loop
sozu    | 2024-08-28T16:41:38.731824Z 1724863298731824709 1 ERROR MAIN  Got a response for an unknown task: INITIAL-STATUS-0-0
sozu    | 2024-08-28T16:41:38.733488Z 1724863298733488229 8 INFO  WRK-01        will try to receive listeners
sozu    | 2024-08-28T16:41:38.733527Z 1724863298733527481 8 INFO  WRK-01        received listeners: Listeners { http: [], tls: [], tcp: [] }
sozu    | 2024-08-28T16:41:38.733540Z 1724863298733540957 8 INFO  WRK-01        starting event loop
sozu    | 2024-08-28T16:41:38.733567Z 1724863298733567325 1 ERROR MAIN  Got a response for an unknown task: INITIAL-STATUS-1-0
sozu    | 2024-08-28T16:41:38.746311Z 1724863298746311430 1 INFO  MAIN  Successfully loaded the config: 30 ok, 0 errors
shoutmarble commented 2 months ago

Hello, anyone?

I tried bundling the sozu binary with any dependencies in my Dockerfile ubuntu-sozu-docker during the build it might have missed.

However, I'm still not getting HTTP-to-HTTPS redirect on my custom ports 8080-to-8443.

I'm not what I mangled with putting sozu in a container.

curl -L -v http://who.example.com:8080 keeps on redirecting to https://who.example.com:8080 and not https://who.example.com:8443

root@server:~/stalwart/scratch# curl -L -v http://who.example.com:8080                                 
* Host who.example.com:8080 was resolved.                                                              
* IPv6: 2a02:4780:10:e8ad::1                                                                           
* IPv4: 185.28.22.166                                                                                  
*   Trying [2a02:4780:10:e8ad::1]:8080...                                                              
* Connected to who.example.com (2a02:4780:10:e8ad::1) port 8080                                        
> GET / HTTP/1.1                                                                                       
> Host: who.example.com:8080                                                                           
> User-Agent: curl/8.5.0                                                                               
> Accept: */*                                                                                          
>                                                                                                      
< HTTP/1.1 301 Moved Permanently                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                     
< Location: https://who.example.com:8080/ ───────▢│https://who.example.com:8443/ β”‚                     
< Connection: close                               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                     
< Content-Length: 0                                                                                    
< Sozu-Id: 01J6GJYQMBTR8370GZTPMKGQYP                                                                  
<                                                                                                      
* Closing connection                                                                                   
* Clear auth, redirects scheme from HTTP to https                                                      
* Issue another request to this URL: 'https://who.example.com:8080/'                                   
* Hostname who.example.com was found in DNS cache                                                      
*   Trying [2a02:4780:10:e8ad::1]:8080...                                                              
* Connected to who.example.com (2a02:4780:10:e8ad::1) port 8080                                        
* ALPN: curl offers h2,http/1.1                                                                        
* TLSv1.3 (OUT), TLS handshake, Client hello (1):                                                      
*  CAfile: /etc/ssl/certs/ca-certificates.crt                                                          
*  CApath: /etc/ssl/certs                                                                              
* OpenSSL/3.0.13: error:0A00010B:SSL routines::wrong version number                                    
* Closing connection                                                                                   
curl: (35) OpenSSL/3.0.13: error:0A00010B:SSL routines::wrong version number     

./sozu --version

root@DESKTOP-3LUEUH3:~/.cargo/bin# ./sozu --version
sozu 1.0.4

tree /root/.cargo/bin

root@DESKTOP-3LUEUH3:~/.cargo/bin# tree
.
β”œβ”€β”€ .
β”œβ”€β”€ .
β”œβ”€β”€ .
└── sozu

0 directories, 18 files

ubuntu-sozu-docker

FROM ubuntu:latest

VOLUME /etc/sozu
VOLUME /run/sozu

RUN mkdir -p /usr/local/bin
RUN mkdir -p /var/lib/sozu/

RUN apt -y update 
RUN apt -y install \
  software-properties-common \
  libgcc-14-dev \
  libgcc-s1-amd64-cross \
  ca-certificates \
  libunwind-15

COPY ./sozu-html-errors/401.html /etc/sozu/html/401.html
COPY ./sozu-html-errors/404.html /etc/sozu/html/404.html
COPY ./sozu-html-errors/408.html /etc/sozu/html/408.html
COPY ./sozu-html-errors/413.html /etc/sozu/html/413.html
COPY ./sozu-html-errors/502.html /etc/sozu/html/502.html
COPY ./sozu-html-errors/503.html /etc/sozu/html/503.html
COPY ./sozu-html-errors/504.html /etc/sozu/html/504.html
COPY ./sozu-html-errors/507.html /etc/sozu/html/507.html

COPY ./certificates/example.com.crt /certs/server.crt
COPY ./certificates/example.com.key /certs/server.key
COPY ./certificates/example.com.pem /certs/server.pem

COPY ./sozu /usr/local/bin/
COPY ./config.toml /etc/sozu/

ENTRYPOINT ["/usr/local/bin/sozu"]
CMD ["start", "-c", "/etc/sozu/config.toml"]
shoutmarble commented 2 months ago

Thank you, I will park this for now.