Forum

You are not logged in.

#1 25-03-2018 11:49:08

Fleurou
Membre
Registered: 03-05-2017
Posts: 11

Static files and CORS

Hello

I am trying to isolate the static files of my website from the dynamic content.

I set-up to "sites" in the alwaysdata admin, one using Python WSGI (for Django) and the other the "static files" configuration. Then, in my Django website, I am including all the files from the static website.

Some of the static files get rejected by the browser because of CORS headers missing on the "static files" website:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at ...
(Reason: CORS header ‘Access-Control-Allow-Origin’ missing) 

My questions: is there a way to configure CORS header in the static files configuration? If not, do you provide the configuration file used by the "static files", so that we can modify by pasting it into a more general site option (apache). In particular, I am interested in the ETag header that do not appear in the Python WSGI configuration and that prevent some phone to access some videos (primary reason why I splited the site into static and non-static)...

Thanks
Fleurou

Offline

#2 26-03-2018 08:49:14

@Cyril
Staff
From: Paris
Registered: 06-02-2007
Posts: 5,645
Website

Re: Static files and CORS

Hello,

You can use a .htaccess file, as "static files" sites are served by Apache.

Offline

#3 27-03-2018 18:33:25

Fleurou
Membre
Registered: 03-05-2017
Posts: 11

Re: Static files and CORS

I will test that, thanks!
Fleurou

Offline

Board footer

Powered by FluxBB