Updated:

Quickstart

This page is a short working flow for updating a static site.
Use it when you change text, add a page, update a tool, build the site, and deploy it safely.

The goal is simple: build and validate dist/ first, deploy it to the web root second, then check production HTTP responses.

Before you start

Do not touch Nginx, HAProxy, or other services when you are only changing site content.

A normal content update only needs:

~/getsrv-static-src
/var/www/getsrv.app
npm run build
rsync dist/
nginx -t
systemctl reload nginx

1. Enter the project directory

cd ~/getsrv-static-src

Check that you are in the right place:

pwd

Expected:

/home/manowar/getsrv-static-src

2. Build the site

npm run build

A healthy build ends with something like:

[build] Complete!

If the build fails, stop here. Do not deploy an empty or incomplete dist/.

3. Check that the build looks valid

find dist -type f -name '*.html' | wc -l
find dist/assets -maxdepth 1 -type f | sort

Expected:

  • HTML pages exist;
  • CSS/JS files are under dist/assets/;
  • there are no unexpected files outside the normal static structure.

4. Check external runtime URLs

grep -RInE 'https?://' dist --exclude='sitemap*.xml' --exclude='robots.txt' | grep -v 'https://getsrv.app' || true

For this site, the normal result is empty output.
If third-party URLs appear, inspect them before deployment.

5. Deploy the build

sudo rsync -a --delete dist/ /var/www/getsrv.app/
sudo find /var/www/getsrv.app -type d -exec chmod 755 {} \;
sudo find /var/www/getsrv.app -type f -exec chmod 644 {} \;
sudo chown -R www-data:www-data /var/www/getsrv.app

--delete matters: it removes old files that no longer exist in the new build.

6. Validate and reload Nginx

sudo nginx -t
sudo systemctl reload nginx

If nginx -t fails, do not reload.

7. Run a quick smoke-test

curl -kI https://getsrv.app/
curl -kI https://getsrv.app/en/docs/
curl -kI https://getsrv.app/en/tools/
curl -kI https://getsrv.app/no-such-page

Expected:

/                 200
/en/docs/         200
/en/tools/        200
/no-such-page     404

8. Check cache and security headers

HTML pages should return a short cache policy:

Cache-Control: public, must-revalidate

Assets under /assets/ should return long immutable caching:

ASSET="$(find /var/www/getsrv.app/assets -maxdepth 1 -type f | head -n 1 | sed 's#^/var/www/getsrv.app##')"
curl -kI "https://getsrv.app$ASSET"

Expected:

Cache-Control: public, max-age=31536000, immutable

When to stop

Stop and do not deploy if:

  • npm run build fails;
  • dist/ is empty or clearly incomplete;
  • unexpected external URLs appear;
  • nginx -t reports an error;
  • smoke-test returns wrong HTTP codes;
  • security headers disappear after deployment.

Minimal command flow

When the process is familiar:

cd ~/getsrv-static-src &&
npm run build &&
sudo rsync -a --delete dist/ /var/www/getsrv.app/ &&
sudo find /var/www/getsrv.app -type d -exec chmod 755 {} \; &&
sudo find /var/www/getsrv.app -type f -exec chmod 644 {} \; &&
sudo chown -R www-data:www-data /var/www/getsrv.app &&
sudo nginx -t &&
sudo systemctl reload nginx

Still run at least one curl -kI check afterwards.