I banged my had against the wall for quite some time, so I thought it’d be useful for someone with similar issues.
I was having problems with the SERVER_PORT variable not being forwarded because I was using a too simple implementation of Caddyfile in V2.
User WeidiDeng did a more expanded form of the Caddyfile sintax that works. However, the syntax used in his post is no longer valid.
If someone has the same problem, here’s an updated caddyfile compliant with the stable build of v2:
domain.com:8445 {
#tls internal
encode gzip
root * /path/main_site
# Previous
# matcher indexFiles {
# Compliant with the table build of v2
@indexFiles {
not {
path */
}
file {
try_files {path}/index.php
}
}
# Previous
# rewrite match:indexFiles {path}/ # No redirect required
# Compliant with the table build of v2
rewrite @indexFiles {path}/ # No redirect required
# internally rewrite directory URIs to index.php files
# try_files {path} {path}/ /index.php/{uri} # Last part is the problem
# THis one works for Laravel
try_files {path} {path}/ /index.php/{query} # Last part is the problem
# proxy any requests for PHP files to backend via FastCGI
#matcher phpFiles {
@phpFiles {
path *.php
}
# reverse_proxy match:phpFiles php-fpm:9000 {
reverse_proxy @phpFiles php-fpm:9000 {
transport fastcgi {
split .php
}
}
file_server
}
We don’t really have any specific roadmap in mind, we usually just tag releases when it makes sense (enough issues/PRs resolved). You can expect it to be in the next few weeks though.