Render a Config Template Safely

medium 20 XP ~7 minHands-on lab

/srv/lab/templates/nginx.conf.tpl is a template with placeholders ${SERVER_NAME}, ${UPSTREAM_PORT} and ${LOG_LEVEL}. Their values are in /srv/lab/templates/prod.env.

Task

Write the rendered file to /home/student/nginx.conf:

  • every ${SERVER_NAME}, ${UPSTREAM_PORT} and ${LOG_LEVEL} is replaced by its value from prod.env
  • everything else stays exactly as it is, including nginx's own variables such as $host, $1 and $request_uri

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

TerminalNot started

Your machine is ready to start

Create a free account to open a machine and get graded.