![]() I still believe there’s a more elegant solution within the nginx config files, and perhaps this conversation should be moved into the Feature reqeusts category. Thanks Ben, this seemed to work! At least it’s a temporary solution so I can remove that Chrome plugin and browse the web safely. So I’m looking for an elegant solution, and I believe editing the nginx configuration files would be that solution. I have bypassed this for the time being by adding a Chrome extension called “Allow CORS: Access-Control-Allow-Origin” however I fear this could expose me to security vulnerabilities if I forget to disable this while navigating to other websites. I’ve also tried to add code as found on this website, but again it doesn’t work because I believe it’s checking the CORS policy on the server-level before even hitting this code. But when adding this to the file and restarting the server I get the typical 502 Request Error message, so this is either conflicting with global code or just not written correctly for the Local nginx environment. I’ve tried multiple ways, following directions on Enable CORS and other sites that show the same code. However, in development mode it will run on This is a requirement, and although I can run it using my Local site domain, the port number still needs to be 3000 or a unique number of my choosing - point is, it cannot be the same port number as Local (e.g. ![]() ![]() In production, CORS will not be an issue because the React app will run on the same domain and port number as the website. Hello there, I realize this is an edge case, but I’m wondering if there is a way to add a CORS policy to the nginx config file for either the full site, or alternately the /wp-json/ portion of the site?īackstory: I am running a React app locally using a project that was bootstrapped with Create React App, so I’m pretty much tied to this environment. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |