I have photoURL http://cs10821.vk.me/u712377/d_9da50e0f.jpg It is does not have header Access-Control-Allow-Origin *; I fix it with nginx. If I write
location /photo/cs10821.vk.me/u712377/d_9da50e0f.jpg {
proxy_pass http://cs10821.vk.me/u712377/d_9da50e0f.jpg;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
add_header Access-Control-Allow-Origin *;
}
all work fine. I write http://servername.ru/photo/cs10821.vk.me/u712377/d_9da50e0f.jpg and I have my photo with header Access-Control-Allow-Origin *; But if I use regex
location ~ ^/photo/(.*)$ {
proxy_pass http://$1;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
add_header Access-Control-Allow-Origin *;
}
I have error 502. Help me please