I have deployed a simple Django application in the AWS server and created a config file in the Nginx as follows.
server {
listen 80;
server_name 127.0.0.1;
location /portal {
include proxy_params;
proxy_pass http://localhost:8000;
}
}
But it is not working and showing as "404 not found".
Django application alone working in a URL as http://public_ip/en/ but I need to serve this application in http://public_ip/portal.
When configured this way, nginx appends the string
/portal
at the end ofproxy_pass
location, that is, your application receives URLhttp://localhost:8000/portal
when you requesthttp://public_ip/portal
.In order for
/portal
requests to reach/en
, you need to use: