Welcome! Log In Create A New Profile

Advanced

Access to XMLHttpRequest has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

All files from this thread

File Name File Size   Posted by Date  
reactjsnginx.conf 2.7 KB open | download kaushalshriyan 05/28/2020 Read message
drupalcmsnginx.conf 2 KB open | download kaushalshriyan 05/28/2020 Read message
May 28, 2020 03:22AM
Hi,

I am running Nginx version: nginx/1.16.1 on CentOS Linux release 7.8.2003
(Core) and have hosted react.js javascript 16.13.1 and Drupal CMS Framework
8.7.8.
https://tmobilereactdrupal.mydomain.com (react.js javascript 16.13.1) which
in turn talks to https://tmobilereactdrupal.mydomain.com:8080 (drupal
framework version 8.7.8). Both react js on port 443 (frontend) and drupal
cms on port 8080 (backend) are running on the same Nginx webserver.

When I hit https://tmobilereactdrupal.mydomain.com (react.js framework
frontend on the port 443) connects to
https://tmobilereactdrupal.mydomain.com:8080 (Drupal CMS 8.7.8 backend on
the port 8080)
I am encountering the below error in Developer tools console which is a
plugin in the browser.

Access to XMLHttpRequest at ‘
> https://tmobilereactdrupal.mydomain.com:8080/oauth/token’ from origin ‘
> https://tmobilereactdrupal.mydomain.com’ has been blocked by CORS policy:
> No ‘Access-Control-Allow-Origin’ header is present on the requested
> resource.


I have attached both the Nginx config file for the react.js framework
(frontend) and Drupal CMS 8.7.8 backend. Any help will be
highly appreciated. I have added add_header 'Access-Control-Allow-Origin'
'*' always; in nginx.conf and is not honoring the settings. I look forward
to hearing from you. Thanks in advance.

Best Regards,

Kaushal
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Attachments:
open | download - reactjsnginx.conf (2.7 KB)
open | download - drupalcmsnginx.conf (2 KB)
Subject Author Posted

Access to XMLHttpRequest has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Attachments

kaushalshriyan May 28, 2020 03:22AM

Re: Access to XMLHttpRequest has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Francis Daly May 28, 2020 08:42AM

Re: Access to XMLHttpRequest has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Sam Henaghan May 28, 2020 08:44AM

Re: Access to XMLHttpRequest has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

kaushalshriyan May 28, 2020 10:48AM

Re: Access to XMLHttpRequest has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Francis Daly May 28, 2020 07:24PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 161
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready