1. Caddy version:
v2.6.3 h1:QRVBNIqfpqZ1eJacY44I6eUC1OcxQ8D04EKImzpj7S8=
2. How I installed, and run Caddy:
Docker
a. System environment:
Ubuntu 22.04
3. The problem I’m having:
I’m having trouble adapting the following NGINX config to Caddy:
server {
listen unix:/dev/shm/h2c.sock http2 proxy_protocol; # H2C server monitor process and enable PROXY protocol reception
set_real_ip_from unix:;
real_ip_header proxy_protocol;
server_name example.com cdn.com;
# grpc settings
grpc_read_timeout 1h;
grpc_send_timeout 1h;
grpc_set_header X-Real-IP $remote_addr;
# website
location / {
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always; # enable HSTS
root /var/www/html;
index index.html index.htm;
}
location /servicename/* {
# POST returns 404 when negotiation fails
if ($request_method != "POST") {
return 404;
}
client_body_buffer_size 1m;
client_body_timeout 1h;
client_max_body_size 0;
grpc_pass grpc://127.0.0.1:3001;
}
}
The extra settings (timeout, etc) are not very important to me, the only important part is the first 4 lines of the server
block!
5. What I already tried:
I have tried the nginx-adapter plugin but it throws errors saying it does not recognize the listen
directive!