Score:0

Angular application CORS issues using Nginx

ht flag

My Angular application is unable to make requests to my backend. This is the Nginx configuration

server {
  listen 0.0.0.0:443 ssl;
  listen [::]:443 ssl;

  server_name my.site.io;

  ssl_certificate /etc/nginx/certificates/my.site.io.crt;
  ssl_certificate_key /etc/nginx/certificates/my.site.io.key;

  root /var/www/my.site.io;

  location / {
    try_files $uri $uri/ /index.html;
    add_header 'Access-Control-Allow-Origin' '*' always;
  }

}

However even if the Access-Control-Allow-Origin is added to the header responses, the status code will be 304 Not Modified. I also tried to add the configuration suggested here: https://enable-cors.org/server_nginx.html without any success.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.