1. The problem I’m having:
I’m trying to host love.js https://github.com/2dengine/love.js
I can host it locally using MAMP/apache but I’m having an issue hosting it using Caddy on my cloud server.
Apache requires two headers to be set, and wasm mime type.
.htaccess
<IfModule mod_headers.c>
Header set Cross-Origin-Opener-Policy "same-origin"
Header set Cross-Origin-Embedder-Policy "require-corp"
</IfModule>
<IfModule mod_mime.c>
AddType application/wasm wasm
</IfModule>
I don’t expect help with love.js itself, I just want to sanity check that I’m doing the caddy equivalent of what is needed for apache.
2. Error messages and/or full log output:
File main.lua does not exist on disk.
- So a problem somewhere in my setup
- curl -vL shows mime type is working
- query parameters are processed using javascript from URL so look OK to me
3. Caddy version:
v2.9.1 h1:OEYiZ7DbCzAWVb6TNEkjRcSCRGHVoZsJinoDR/n9oaY=
4. How I installed and ran Caddy:
dnf install caddy
a. System environment:
Oracle Linux 8 (RHEL8)
b. Command:
systemctl start caddy
c. Service/unit/compose file:
n/a
d. My complete Caddy config:
love2d.gingerbeardman.com {
tls email@example.com
encode zstd gzip
root * /var/www/love2d.gingerbeardman.com/htdocs
file_server
header {
Cross-Origin-Opener-Policy "same-origin"
Cross-Origin-Embedder-Policy "require-corp"
}
@wasm {
file
path *.wasm
}
header @wasm Content-Type "application/wasm"
}