My default file :
upstream backend {
server localhost:5000;
}
server {
root /var/www/app/build;
index index.html index.htm index.nginx-debian.html;
server_name my_server_name;
location / {
try_files $uri $uri/ /index.html;
}
location /api/ {
proxy_pass http://backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Timeout-uri pentru conexiunile cu backend-ul
proxy_connect_timeout 15s;
proxy_send_timeout 30s;
proxy_read_timeout 30s;
send_timeout 30s;
# Protecția împotriva HTTP Flooding (Rate Limiting)
add_header X-Frame-Options "DENY";
add_header X-Content-Type-Options "nosniff";
add_header X-XSS-Protection "1; mode=block";
add_header Content-Security-Policy "default-src 'self'";
}
Error in console
enter image description here
When I try to POST i have this error but when I use GET its ok
(I am beginner)
I tried to change default file many times but no results(
New contributor
Mihai Boinceanu2004 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.