Added cross origin parameters to nginx location parts
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
global
|
global
|
||||||
log stdout format raw local0 debug
|
log stdout format raw local0 info
|
||||||
defaults
|
defaults
|
||||||
mode http
|
mode http
|
||||||
option redispatch
|
option redispatch
|
||||||
|
@@ -85,6 +85,7 @@ if [[ "$HTTP_PORT" != "" && "$HTTP_PORT" != "80" ]]; then
|
|||||||
|
|
||||||
else
|
else
|
||||||
echo "location / {"
|
echo "location / {"
|
||||||
|
echo "add_header 'Access-Control-Allow-Origin' '*' always;"
|
||||||
|
|
||||||
if [[ "$ALLOWED_NETWORK" != "" ]]; then
|
if [[ "$ALLOWED_NETWORK" != "" ]]; then
|
||||||
ALLOWED_NETWORK_IDX=$(jq -r '.ALLOWED_NETWORK | length' $DOMAIN_SOURCE)
|
ALLOWED_NETWORK_IDX=$(jq -r '.ALLOWED_NETWORK | length' $DOMAIN_SOURCE)
|
||||||
@@ -177,7 +178,7 @@ location = /$ERROR_PAGE {
|
|||||||
root html;
|
root html;
|
||||||
allow all;
|
allow all;
|
||||||
index 404.html;
|
index 404.html;
|
||||||
rewrite ^ "'$scheme'":http://$ERROR_PAGE"'$request_uri'" permanent;
|
rewrite ^ "'$scheme' "http://$ERROR_PAGE"'$request_uri'" permanent;
|
||||||
}"
|
}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -185,6 +186,7 @@ location = /$ERROR_PAGE {
|
|||||||
echo "return 301 $REDIRECT_HTTPS;"
|
echo "return 301 $REDIRECT_HTTPS;"
|
||||||
else
|
else
|
||||||
echo "location / {"
|
echo "location / {"
|
||||||
|
echo "add_header 'Access-Control-Allow-Origin' '*' always;"
|
||||||
|
|
||||||
if [[ "$ALLOWED_NETWORK" != "" ]]; then
|
if [[ "$ALLOWED_NETWORK" != "" ]]; then
|
||||||
ALLOWED_NETWORK_IDX=$(jq -r '.ALLOWED_NETWORK | length' $DOMAIN_SOURCE)
|
ALLOWED_NETWORK_IDX=$(jq -r '.ALLOWED_NETWORK | length' $DOMAIN_SOURCE)
|
||||||
|
Reference in New Issue
Block a user