Cancelled

Fix No 'Access-Control-Allow-Origin' PHP

Hi,

I am getting No 'Access-Control-Allow-Origin' Error my site, it NGINX.

My page is trying to get data from my storage server, its trying to get fonts and some images in CSS Ex.

----------------------------------------------

@font-face {

font-family: JCQBAA-BTraffic_1bn;

src: url("http://www.***.com/10356/fonts/[url removed, login to view]") format("woff");

}

-----------------------------------------------

data="http://www.***.com/10356/1/[url removed, login to view]"

What I already tried is.

* Add header on top of PHP page

-----------------------------------------------

$origin=isset($_SERVER['HTTP_ORIGIN'])?$_SERVER['HTTP_ORIGIN']:$_SERVER['HTTP_HOST'];

header('Access-Control-Allow-Origin: '.$origin);

header('Access-Control-Allow-Methods: POST, OPTIONS, GET, PUT');

header('Access-Control-Allow-Credentials: true');

header('Access-Control-Allow-Headers: Authorization, X-Requested-With');

header('P3P: CP="NON DSP LAW CUR ADM DEV TAI PSA PSD HIS OUR DEL IND UNI PUR COM NAV INT DEM CNT STA POL HEA PRE LOC IVD SAM IVA OTC"');

header('Access-Control-Max-Age: 1');

* Add on Nginx.

-----------------------------------------------

location ~* \.(eot|otf|ttf|woff|woff2)$ {

add_header Access-Control-Allow-Origin "***.com";

}

location / {

if ($http_origin ~ "^(http://www.***.com)$") {

add_header "Access-Control-Allow-Origin" $http_origin;

}

}

We are trying to get this on both http and https sites.

Skills: Javascript, PHP, Web Hosting, Website Testing

See more: php mysql role based access control, website access script php allow address, joomla restricted access fix, joomla component administrator control expiration access, restricted access fix, php allow login, php panel control, php panel control iis, php webcam control, php game control panel, php projects control panel, php stock control, php serverffs control panel, php hosting control panel, php stock control systems interface

About the Employer:
( 19 reviews ) Patiala, Canada

Project ID: #13017355

8 freelancers are bidding on average $33 for this job

$24 CAD in 1 day
(104 Reviews)
6.2
MrMSparrow

Hello, I am a UK based developer with plenty of experience in PHP. I have written both new projects and maintain a lot of websites for my clients. Please contact me to get the nginx headers error resolved today.

$88 CAD in 0 days
(53 Reviews)
6.4
amutinda

A proposal has not yet been provided

$30 CAD in 1 day
(45 Reviews)
5.3
diama64

Hello there , my name is Diamantis Fersizidis im a web designer from greece. I have 3 years experience in web design and development and I am looking forward to work with you on this project. You can check s More

$19 CAD in 1 day
(52 Reviews)
4.7
zenati2

can you send me link where you are facing this error are you using your website on hosting or server? thanks

$25 CAD in 1 day
(29 Reviews)
4.3
$25 CAD in 0 days
(31 Reviews)
4.5
palak17

We are having an experience of 5 years and also provide surety of quality [login to view URL] are also having the team with innovative & creative ideas and good experienced in Google Analytic s and Internet Marketing and Web and G More

$25 CAD in 1 day
(22 Reviews)
3.4
samiem41

I solved this kind of problem few days back. check my completed projects. I think i can solve this.

$30 CAD in 2 days
(5 Reviews)
2.5