Nginx Django неправильный путь
Вот конфигурационный файл Nginx:
server {
server_name atlasalgorithms.com www.atlasalgorithms.com;
root /home/ubuntu/tc/react/build;
index index.html index.htm index.nginx-debian.html;
location /api {
limit_req zone=one;
limit_conn addr 10;
include proxy_params;
proxy_pass http://unix:/home/ubuntu/tc/config.sock;
}
location / {
try_files $uri /index.html;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/atlasalgorithms.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/atlasalgorithms.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.atlasalgorithms.com) {
return 301 https://atlasalgorithms.com$request_uri;
} # managed by Certbot
if ($host = atlasalgorithms.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name atlasalgorithms.com www.atlasalgorithms.com;
return 404; # managed by Certbot
}
Проблема в том, что Django читает этот путь /api
, у меня есть конечная точка API /dashboard
, когда я перехожу к https://atlasalgorithms.com/api/dashboard/
Django читает путь как api/dashboard/
, что приводит к Page not found (404)
The current path, api/dashboard/, didn’t match any of these.
Как я могу это исправить?