Sorry guys, … I’m not finding it !
I’ve looked into the NGINX (reverse proxy) conf files and have seen nothing about CORS.
In my nextcloud jail, I’ve tried editing .htaccess (seen Enabling CORS on NextCloud | amos2021ws03-teams-to-nextcloud) with the 3 variants below (one after the other, each time restarting Apache24 with no errors):
Header always add Access-Control-Allow-Origin "https://server.arcgisonline.com"
Header always add Access-Control-Allow-Headers "Authorization, Origin, X-Requested-With, Content-Type, Accept, DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Range, Range, Depth, Destination"
Header always add Access-Control-Allow-Methods "GET, HEAD, POST, PUT, OPTIONS, MOVE, DELETE, COPY, LOCK, UNLOCK, PROPFIND, MKCOL"
Header always add Access-Control-Allow-Credentials "true"
=> FAILED
Header onsuccess unset Access-Control-Allow-Origin
Header always set Access-Control-Allow-Origin *
=> FAILED
Header always set Cross-Origin-Resource-Policy cross-origin
=> FAILED
Here is what I get from https://www.webconfs.com/http-header-check.php with the last attempt:
HTTP/1.1 401 Unauthorized =>
Server => nginx/1.24.0
Date => Sun, 17 Nov 2024 18:16:45 GMT
Content-Type => application/json; charset=utf-8
Content-Length => 43
Connection => close
X-Powered-By => PHP/8.3.1
X-Request-Id => ro8yvbfuamnNZOyzGTQC
Cache-Control => no-cache, no-store, must-revalidate
Content-Security-Policy => default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'
Feature-Policy => autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'
X-Robots-Tag => noindex, nofollow
Set-Cookie => ocifuporzzjg=p855iljj7vi66vjett6qscrutv; path=/; secure; HttpOnly; SameSite=Lax
Referrer-Policy => no-referrer
X-Content-Type-Options => nosniff
X-Frame-Options => SAMEORIGIN
X-Permitted-Cross-Domain-Policies => none
X-XSS-Protection => 1; mode=block
Cross-Origin-Resource-Policy => cross-origin
Strict-Transport-Security => max-age=63072000
Still the error:
The resource at “https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/15/10892/16362” was blocked due to its Cross-Origin-Resource-Policy header (or lack thereof)
Herebelow the content of section ‘mod-env.c’ in my .htaccess file:
<IfModule mod_env.c>
# Add security and privacy related headers
# Avoid doubled headers by unsetting headers in "onsuccess" table,
# then add headers to "always" table: https://github.com/nextcloud/server/pull/19002
Header onsuccess unset Referrer-Policy
Header always set Referrer-Policy "no-referrer"
Header onsuccess unset X-Content-Type-Options
Header always set X-Content-Type-Options "nosniff"
Header onsuccess unset X-Frame-Options
Header always set X-Frame-Options "SAMEORIGIN"
Header onsuccess unset X-Permitted-Cross-Domain-Policies
Header always set X-Permitted-Cross-Domain-Policies "none"
Header onsuccess unset X-Robots-Tag
Header always set X-Robots-Tag "noindex, nofollow"
Header onsuccess unset X-XSS-Protection
Header always set X-XSS-Protection "1; mode=block"
## Manually added lines below for management of cross origins resources as per https://amosproj.github.io/amos2021ws03-teams-to-nextcloud/Documentation/EnablingCORSonNextcloud.html
#Header always add Access-Control-Allow-Origin "https://server.arcgisonline.com"
#Header always add Access-Control-Allow-Headers "Authorization, Origin, X-Requested-With, Content-Type, Accept, DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache>
#Header always add Access-Control-Allow-Methods "GET, HEAD, POST, PUT, OPTIONS, MOVE, DELETE, COPY, LOCK, UNLOCK, PROPFIND, MKCOL"
#Header always add Access-Control-Allow-Credentials "true"
## Other attempt but removed... must be overridden by Nextcloud or NGINX reverse proxy
# Header onsuccess unset Access-Control-Allow-Origin
# Header always set Access-Control-Allow-Origin *
## Other try... no success
Header always set Cross-Origin-Resource-Policy cross-origin
SetEnv modHeadersAvailable true
</IfModule>
'Could really do with some assistance, please.
Let me know if you need more info.
Thanks !