directadmin:nginx-cors
DirectAdmin enable CORS on nginx
To enable CORS for domains, open You DirectAdmin CutomHTTPD editor:
https://SERVER:2222/CMD_CUSTOM_HTTPD?domain=DOMAIN.TLD&proxy=yes
To CUSTOM2 section add:
# Simple requests if ($request_method ~* "(GET|POST)") { add_header "Access-Control-Allow-Origin" *; } # Preflighted requests if ($request_method = OPTIONS ) { add_header "Access-Control-Allow-Origin" *; add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS, HEAD"; add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept"; return 200; }
directadmin/nginx-cors.txt · Last modified: 2018/05/14 09:55 by dreiggy