/etc/Caddyfile:52 - Parse error: Unexpected EOF

I used this script to successfully install two Ghost blogs: GitHub - githubber/Ghost-over-Caddy: This repo/script will install Ghost blog over Caddy web server as a reverse proxy.

I then thought it would be easy to add another Wordpress site.

I added the details for the Wordpress site to the /etc/Caddyfile.

Caddy would not restart. I fiddled with the settings, no luck, then just deleted the added Wordpress details so that the original /etc/Caddyfile content was left, but now it still won’t start. journalctl -u caddy gives me
2017/07/28 05:42:43 /etc/Caddyfile:51 - Parse error: Unexpected EOF and again
2017/07/28 05:44:08 /etc/Caddyfile:52 - Parse error: Unexpected EOF

Other Wordpress tutorials suggested particular plugins to be bundled with Caddy, but all I used to install that was the above script. Why would Caddy be stalling here. I thought all I needed to do was add to the Caddyfile.

PhP is installed, fastcgi / /var/run/php/php7.0-fpm.sock php, and running.

I am not sure if my reverse

Any ideas? Is there more to running both Ghost blogs and a Wordpress blogs?

Thank you!

What is your entire Caddyfile?

Thank you for taking a look.

ghost1.com {
    proxy / 127.0.0.1:2368 {
        header_upstream Host {host}
        header_upstream X-Real-IP {remote}
        header_upstream X-Forwarded-For {remote}
        header_upstream X-Forwarded-Proto {scheme}
    }
    timeouts 3m
    tls me@myemail.com
    log /var/log/caddy/ghost1.com-access.log
    errors /var/log/caddy/ghost1.com-error.log
}
ghost2.com {
    proxy / 127.0.0.1:2370 {
        header_upstream Host {host}
        header_upstream X-Real-IP {remote}
        header_upstream X-Forwarded-For {remote}
        header_upstream X-Forwarded-Proto {scheme}
    }
    timeouts 3m
    tls me@myemail.com
    log /var/log/caddy/ghost2.com-access.log
    errors /var/log/caddy/ghost2.com-error.log
}
wordpress.buzz {
    root /var/caddywww/wordpressfolder
    gzip
    fastcgi / /var/run/php/php7.0-fpm.sock php
    timeouts 3m
    tls me@myemail.com
    log /var/log/caddy/wordpress.buzz-access.log
    errors /var/log/caddy/wordpress.buzz-error.log
    rewrite /{
        to {path} {path}/ /index.php?{query}
    }
}

I bet this is it: you’re missing a space here:

rewrite /{

Just a hunch though.

Also, I formatted your post with code blocks so it’s legible. (three backticks on their own line)

Could you direct me to the page with formatting instructions please? I just tried thre backticks but nothing happened.

I added the space and restarted, let’s see.

EDIT: Welp, Caddy does start up, the two Ghost blogs are blazing fast, but the Wordpress site returns a 502 Bad Gateway error. Not sure what that is. Is this something to do with PHP-FPM?

The first time(s) you write a topic, a help text appears and the first point says:

  • Enclose Caddyfile contents and code in three backticks (```) on their own line for formatting.

This is just usual Markdown formatting as is on other forums and sites (Stack Overflow sites, GitHub, and a number of other software).

Hm, a 502 error means it’s having trouble communicating with FastCGI and/or your backend. You can google around for that error and look on the Caddy wiki.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.