mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 02:48:38 -04:00
Allowing CORS from Controller :8087 to API to know when first repair has completed.
This commit is contained in:
parent
ebac4fdfa2
commit
bfaf1514da
2 changed files with 18 additions and 1 deletions
|
|
@ -45,6 +45,23 @@ http {
|
|||
ssl_certificate /etc/nginx/cert.crt;
|
||||
ssl_certificate_key /etc/nginx/cert.key;
|
||||
|
||||
# CORS headers for Controller direct access (http://host:8087 -> https://host/api)
|
||||
# Added at server level so they apply to error pages (502, etc.)
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'Content-Type, Accept' always;
|
||||
|
||||
# Override http-level error_page to use named location with CORS
|
||||
error_page 502 503 504 @error_with_cors;
|
||||
|
||||
location @error_with_cors {
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'Content-Type, Accept' always;
|
||||
root /var/www;
|
||||
try_files /50x.html =502;
|
||||
}
|
||||
|
||||
include /etc/nginx/conf.d/*;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue