"Melbourne": WSGI with Gunicorn
Scenario: "Melbourne": WSGI with Gunicorn
Level: Medium
Type: Fix
Tags: gunicorn nginx pro python systemd
Access: Paid
Description: There is a Python WSGI web application at /home/admin/wsgi.py that should serve the string Hello, world!. It is run by Gunicorn, fronted by nginx (both under systemd). Request flow: client (curl) → nginx (:80) → Gunicorn (Unix domain socket) → wsgi.py.
Gunicorn is already configured to listen on the Unix socket file /run/gunicorn/gunicorn.sock (see /etc/systemd/system/gunicorn.service). Nginx must proxy to that same filesystem path.
Make curl to localhost on port 80 return Hello, world! using this nginx → Gunicorn → WSGI setup.
Root (sudo) Access: True
Test: curl -s http://localhost returns Hello, world! (served via Gunicorn and nginx; both services must be running).
The "Check My Solution" button runs the script /home/admin/agent/check.sh, which you can see and execute.
Time to Solve: 40 minutes.