I want to pass the CORS test of https://cors-test.codehappy.dev/ for my website for the directory https://ereignishorizont.xyz/.well-known, but I always get the response “This URL will not work correctly with CORS.”.
I have already extended the vhost.conf with this:
context /.well-known/ {
location $VH_ROOT/public_html/.well-known/
allowBrowse 1
rewrite {
enable 0
}
addDefaultCharset off
header add Access-Control-Allow-Origin “*”
header add Access-Control-Allow-Methods “GET, POST, OPTIONS”
header add Access-Control-Allow-Headers “Content-Type, Authorization”
}
I added in the Rewrite Rules:
Header set Access-Control-Allow-Origin "*" Header set Access-Control-Allow-Methods "GET, POST, OPTIONS" Header set Access-Control-Allow-Headers "Content-Type"I added the file .htaccess in the folder .well-known and filed it with:
Header set Access-Control-Allow-Origin "*" Header set Access-Control-Allow-Methods "GET, POST, OPTIONS" Header set Access-Control-Allow-Headers "Content-Type"I restarted the server with: systemctl restart lsws
I purged with: curl -X PURGE https://ereignishorizont.xyz/.well-known/
But the https://cors-test.codehappy.dev website always gives me this error.
https://cors-test.codehappy.dev/?url=https%3A%2F%2Fereignishorizont.xyz%2F.well-known&origin=https%3A%2F%2Fcors-test.codehappy.dev%2F&method=get
Why can’t I get CORS to run for the .well-known folder? Any help?