I am using aspcore sdk3.1, when I published my application on nginx without any configuration in My App, I saw that the web server automatically added 1access-control-allow-origin:*1 Header to all my requests.
Can I delete this header in my application And Add My Own Allow-Origin Header? , because I do not have access to the web server settings
2
Answers
http {
}
This IS My Config Code Whats Wrong?
If nginx adds the CORS allow all origin header, then there must be some configuration like this one here
add_header
lines wherever you don’t want them and you’ll be fine.It seems that https://serverfault.com/questions/751678/how-can-i-replace-access-control-allow-origin-header-in-proxy-response-with-ngin/927668#927668 add header will override the one added to the request by net-core configuration, so you seem to be out of luck.