LT
Size: a a a
LT
DA
gg
Access to XMLHttpRequest at 'http://sockjs-mt1.pusher.com/pusher/app/123/300/1bpli7ee/xhr_streaming?protocol=7&client=js&version=5.0.3&t=1582188905217&n=1' from origin 'http://griw.b220.ru' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.
gg
server {
listen 80;
listen 443 ssl;
ssl_certificate /home/grigoriy/ssl/gri.b220.ru/certificate.crt;
ssl_certificate_key /home/grigoriy/ssl/gri.b220.ru/private.key;
server_name gri.b220.ru evolpay.local;
error_log /home/grigoriy/Projects/evolpay.local/logs/error.log error;
access_log /home/grigoriy/Projects/evolpay.local/logs/access.log combined;
root /home/grigoriy/Projects/evolpay.local/public;
index index.html index.php;
location / {
add_header "Access-Control-Allow-Headers" "*" always;
try_files $uri $uri/ /index.php?$query_string;
}
location ~* \.php$ {
try_files $uri = 404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; # подключаем сокет php-fpm
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
# cors configuration
# whitelist of allowed domains, via a regular expression
# if ($http_origin ~* (http://localhost(:[0-9]+)?)) {
if ($http_origin ~* .*) { # yeah, for local development. tailor your regex as needed
set $cors "true";
}
# apparently, the following three if statements create a flag for "compound conditions"
if ($request_method = OPTIONS) {
set $cors "${cors}options";
}
if ($request_method = GET) {
set $cors "${cors}get";
}
if ($request_method = POST) {
set $cors "${cors}post";
}
# now process the flag
if ($cors = 'trueget') {
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Credentials' 'true';
}
if ($cors = 'truepost') {
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Credentials' 'true';
}
if ($cors = 'trueoptions') {
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Max-Age' 1728000; # cache preflight value for 20 days
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since';
add_header 'Content-Length' 0;
add_header 'Content-Type' 'text/plain charset=UTF-8';
return 204;
}
}
}
DA
k
gg
gg