Welcome! Log In Create A New Profile

Advanced

Re: 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
Francis Daly
May 28, 2020 07:24PM
On Thu, May 28, 2020 at 08:16:43PM +0530, Kaushal Shriyan wrote:
> On Thu, May 28, 2020 at 6:11 PM Francis Daly <francis@daoine.org> wrote:
> > On Thu, May 28, 2020 at 12:50:34PM +0530, Kaushal Shriyan wrote:

Hi there,

> > In your "drupal" nginx config, if the request is handled in the "php"
> > location, there is no Access-Control-Allow-Origin header added.
> >
> > You might want the "add_header" line there instead.

> I have added *add_header 'Access-Control-Allow-Origin' 'origin-list';* in
> the drupal Nginx config (/etc/nginx/conf.d/drupalbackend.conf)

> [root@nginx]# nginx -t -c /etc/nginx/nginx.conf
> > nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
> > nginx: configuration file /etc/nginx/nginx.conf test is successful

Presumably that file does "include" the file you modified?

> I am still encountering the same issue.
>
> 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.
> > POST https://tmobilereactdrupal.mydomain.com:8080/oauth/token
> > net::ERR_FAILED

What headers are present in the response to that POST request?

Does the drupal-nginx log file show that the request was received
by nginx?

Cheers,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
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: 166
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