Closed MikeTheCanuck closed 6 years ago
Is this still an issue? I'm pretty sure we got all the url routing figured out around https://github.com/hackoregon/elections-2018-backend/commit/7c3f0f05ed2057fa19af13651612dba720121679
Yep, looking good - thanks for reminding me, I've harvested these notes over to https://github.com/hackoregon/civic-devops/issues/168
The base service URL for this project's API in AWS is http://service.civicpdx.org/local-elections/
Currently requests to this URL return 502 Bad Gateway. This is a result of a few factors:
/local-elections/
is routed to a separate container pair than the requests for/transportation-systems/
gunicorn
lightweight web server (that hosts the Django code) needs to know where to route each request within the application - a request for/transportation-systems/
is answered by separate Django code from/transportation-systems/biketown/
for example. Thus the external route/local-elections/
must be explicitly specified in theurls.py
configurations of the Django project, and then specify each of the endpoint routes separately in each of the "Django app"urls.py
configurations.To tie it all together, this is exactly what is happening here:
/local-elections/
- and awaits any response with HTTP code 200 - 299gunicorn
receives that request for/local-elections/
and maps it to any of the URL routes that are published inurls.py
, but currently doesn't find that routegunicorn
returns a 404 Not Found response to ALB for that request, which is exactly what we see in the CloudWatch logs that record the output fromgunicorn
:10.180.21.252 [02/Jun/2018:16:22:06 +0000] GET /local-elections/ HTTP/1.1 404 90 - ELB-HealthChecker/2.0 16.020645