docker-nginx-webdav
docker-nginx-webdav copied to clipboard
enable cors in nginx
Hello,
the webdav server is working like a charm. But it would be very helpful if the nginx webserver is configured with cors enabled. This is neccessary for static js/html apps. For example keeweb.
Maybe you can provide a ev parameter for allowed hosts that then is repected by the cors settings of nginx. Example:
ALLOWED_HOSTS = "https://www.host1.de, http://hopst2.de"
Cors in nginx can be enabled like this for example:
To allow access from ALL websites:
server{
...
add_header Access-Control-Allow-Origin *;
...
}
To allow access from multiple domains:
server {
...
add_header Access-Control-Allow-Origin "example1.com";
add_header Access-Control-Allow-Origin "example2.com";
add_header Access-Control-Allow-Origin "example3.com";
...
}