31/60
Sign inSign up free

405. 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.

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.