nginx config to caddy


(蚂蚁先生) #1

Hi, I try to convert NGINX config to Caddy, But always get 404 No such site.
here is nginx config:


server {
        listen 443 ssl;
        server_name static.abc.com;
        ssl_certificate    pic.pem;
        ssl_certificate_key    pic.key;
        ssl_session_timeout 5m;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        location / {
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass http://somedomain.com/; 
                expires 1y; 
        }
}

this is my Caddyfile

static.abc.com {
    proxy / http://somedomain.com/ {
       transparent
    }
    log stdout
    errors stdout
    gzip
}

(Matthew Fay) #2

Hi @mr-ant,

Can you please post the output from Caddy when you start it (it should output a list of domains it is configured to serve), the exact URL you’re browsing to where you receive the Status 404, and the output of curl -IL static.abc.com from shell.


(蚂蚁先生) #3

Hi,
Just forget docker-compose build,fixed it . Thanks.