Q:

No 'Access-Control-Allow-Origin' header is present on requested resource

I know this qquestion has asked several times but none has solved my problem.I am using axios for fetching the token from the server(http://dev.site.com:82/token). I am working on localhost. I have supplied the header too but still i get an error of No 'Access-Control-Allow-Origin' header is present. Is this error being produced from my js code(axios) or it is a problem in server?
const config = {
    method: 'get',
    url: `${API_URL}/token`,
    headers: {
        'Access-Control-Allow-Origin': '*',
        'Content-Type': 'application/json',
       },
  };

export function getToken() {
  return function (dispatch) {
    console.log('action triggered atleast');
    axios.request(config)
    .then(response => {
      console.log('response', response);
      localStorage.setItem('token', response.data.token);
      dispatch({ type: GET_TOKEN });
    })
    .catch(error => {
      errorHandler(dispatch, error.response, TOKEN_ERROR);
    });
  };
}

Have i done any mistake or missed something in my code? 
UDPATE
add_header 'Access-Control-Allow-Origin' "*";
        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
        add_header 'Access-Control-Allow-Headers' 'X-CustomHeader,Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With';
        # required to be able to read Authorization header in frontend
        add_header 'Access-Control-Expose-Headers' 'Authorization' ;

if ($request_method = 'OPTIONS') {
        # Tell client that this pre-flight info is valid for 20 days
        add_header 'Access-Control-Max-Age' 1728000;
        add_header 'Content-Type' 'text/plain charset=UTF-8';
        add_header 'Content-Length' 0;
        return 204;
}

Above is my nginx configuration.

A:

The server need to send the back the CORS header not the request
Take a look here how to enable cors: http://enable-cors.org/server.html
If you don't have access to the server then maybe you want to try something like a cors proxy

