diff --git a/src/freedombone-app-pleroma b/src/freedombone-app-pleroma index 432e2303..66df712b 100755 --- a/src/freedombone-app-pleroma +++ b/src/freedombone-app-pleroma @@ -1058,7 +1058,13 @@ function install_pleroma { echo ' limit_conn conn_limit_per_ip 50;'; echo ' limit_req zone=req_limit_per_ip burst=50 nodelay;'; echo ''; - echo " add_header 'Access-Control-Allow-Origin' '*';"; + echo " add_header 'Access-Control-Allow-Origin' '*' always;"; + echo " add_header 'Access-Control-Allow-Methods' 'POST, GET, OPTIONS' always;"; + echo " add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type' always;"; + echo " if (\$request_method = OPTIONS) {"; + echo ' return 204;'; + echo ' }'; + echo ''; echo ' proxy_http_version 1.1;'; echo " proxy_set_header Upgrade \$http_upgrade;"; echo ' proxy_set_header Connection "upgrade";'; @@ -1113,7 +1119,13 @@ function install_pleroma { echo ' limit_conn conn_limit_per_ip 50;'; echo ' limit_req zone=req_limit_per_ip burst=50 nodelay;'; echo ''; - echo " add_header 'Access-Control-Allow-Origin' '*';"; + echo " add_header 'Access-Control-Allow-Origin' '*' always;"; + echo " add_header 'Access-Control-Allow-Methods' 'POST, GET, OPTIONS' always;"; + echo " add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type' always;"; + echo " if (\$request_method = OPTIONS) {"; + echo ' return 204;'; + echo ' }'; + echo ''; echo ' proxy_http_version 1.1;'; echo " proxy_set_header Upgrade \$http_upgrade;"; echo ' proxy_set_header Connection "upgrade";';