1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

nginxでのCORS設定

1
Posted at

ngnixで直接responseを返すときに、CORS設定をしないと、client側でresponseを読み取れない問題があります。

413エラーの場合、以下の設定で、問題解決できます

  error_page 413 @413;

  location @413 {
    add_header Access-Control-Allow-Methods 'GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS';
    add_header Access-Control-Allow-Origin '*' always;
    return 413;
  }
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?