mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
portalapi: add CORS headers ... though gotta revisit this later, I don't know what I'm doing
This commit is contained in:
parent
5e1d69a2cb
commit
5104c2a79f
1 changed files with 15 additions and 2 deletions
|
@ -25,12 +25,25 @@ location = /yunohost/api/error/502 {
|
|||
}
|
||||
|
||||
location /yunohost/portalapi/ {
|
||||
proxy_read_timeout 3600s;
|
||||
|
||||
# FIXME FIXME FIXME : we should think about what we really want here ...
|
||||
more_set_headers "Access-Control-Allow-Origin: $http_origin";
|
||||
more_set_headers "Access-Control-Allow-Methods: GET, HEAD, POST, OPTIONS, DELETE";
|
||||
more_set_headers "Access-Control-Allow-Headers: Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With";
|
||||
more_set_headers "Access-Control-Allow-Credentials: true";
|
||||
|
||||
if ($request_method = 'OPTIONS') {
|
||||
more_set_headers "Content-Type: text/plain; charset=utf-8";
|
||||
more_set_headers "Content-Length: 0";
|
||||
return 204;
|
||||
}
|
||||
|
||||
proxy_read_timeout 5s;
|
||||
proxy_pass http://127.0.0.1:6788/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header Host $http;
|
||||
|
||||
# Custom 502 error page
|
||||
error_page 502 /yunohost/portalapi/error/502;
|
||||
|
|
Loading…
Add table
Reference in a new issue