To enable https, I set AWS load balancer in front of my ec2 instance. I can access Django Rest api services and admin on ec2 through Public IP. But when I try to get api response through load balancer DNS name or correspondingly domain name, e.g., example.com, I can see the welcome page of nginx. If I type example.com/api, it shows nginx not found. I have stuck for a long time, and don't know if there is something that I misunderstood. My nginx configuartion is as followed.
server {
listen 80;
server_name server_domain_or_IP;
enter code here
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/sammy/myproject;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/sammy/myproject/myproject.sock;
}
}
location /tolocation ^~ /api- Amit Baranes