Updated:

Troubleshooting

This page is a practical playbook for cases where the site “builds fine” but behaves incorrectly in the browser or through curl.

The best order is: first find where the problem is — build output, web root, Nginx, or browser cache. Do not start by editing configuration files.

Quick symptom map

SymptomCheck first
Homepage returns 403Empty web root, missing index.html, file permissions
Existing page returns 404Missing path/index.html in dist or /var/www
Old page after deployBrowser cache, wrong web root, deploy did not run
CSS/JS missing/assets/ not deployed, wrong permissions, wrong asset path
Security headers missingActive Nginx location does not add them
Asset has no immutableFile is not served from /assets/
HTML has long cacheHTML and asset cache policy were mixed up

1. Check Nginx

sudo nginx -t
sudo systemctl status nginx --no-pager

Expected:

syntax is ok
test is successful
active (running)

If nginx -t reports an error, fix it first. Do not reload or restart until the test succeeds.

2. Check listeners

sudo ss -lntp | grep -E ':(80|443|7443|10443|11443)\b'

A content-only update must not change listeners.

If the local Nginx listener or public edge listener disappeared, the issue is no longer a site-content issue.

3. Check build output

cd ~/getsrv-static-src
npm run build
find dist -type f -name '*.html' | wc -l
find dist -maxdepth 3 -type f | sort | sed -n '1,160p'

Check that these exist:

dist/index.html
dist/en/index.html
dist/en/docs/index.html
dist/en/tools/index.html
dist/assets/

If dist/ is empty or page count dropped sharply, do not deploy.

4. Check production web root

sudo find /var/www/getsrv.app -maxdepth 3 -type f | sort | sed -n '1,160p'
sudo ls -la /var/www/getsrv.app | sed -n '1,80p'

For the homepage, this file must exist:

/var/www/getsrv.app/index.html

For /en/docs/cache-control/, this file must exist:

/var/www/getsrv.app/en/docs/cache-control/index.html

5. If the homepage returns 403

Check index.html:

test -f /var/www/getsrv.app/index.html && echo "index OK" || echo "index missing"

Check permissions:

namei -l /var/www/getsrv.app/index.html

Quick permission fix:

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

Then:

curl -kI https://getsrv.app/

6. If an existing page returns 404

Example: /en/docs/cache-control/.

Check production:

test -f /var/www/getsrv.app/en/docs/cache-control/index.html && echo "page OK" || echo "page missing"

Check build output:

test -f ~/getsrv-static-src/dist/en/docs/cache-control/index.html && echo "dist page OK" || echo "dist page missing"

If the file exists in dist but not in /var/www, deploy again:

sudo rsync -a --delete ~/getsrv-static-src/dist/ /var/www/getsrv.app/

If the file does not exist in dist, the problem is in the Astro route or filename.

7. If CSS/JS is missing

Check assets:

find /var/www/getsrv.app/assets -maxdepth 1 -type f | sort

Check the first asset:

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:

HTTP/2 200
Cache-Control: public, max-age=31536000, immutable

If the asset returns 404, check that Astro build.assets matches the Nginx /assets/ location.

8. If security headers are missing

Check:

curl -kI https://getsrv.app/ | grep -Ei 'content-security-policy|x-frame-options|x-content-type-options|referrer-policy|permissions-policy'

Expected: all main headers are present.

If not, inspect the active Nginx location. In Nginx, add_header may not be inherited if a location defines its own add_header.

9. If the browser shows an old page

Check the server first:

curl -ks https://getsrv.app/ | grep -oE 'Technical reference|web operations|Docs' | sort -u

If curl shows the new version but the browser does not:

  • use Ctrl+F5;
  • open DevTools → Network → Disable cache;
  • try a private window.

If curl also shows the old version, the deploy did not run or the wrong web root is being served.

10. If deployment made things worse

Do not change multiple layers at once. Roll back the web root from backup first:

sudo rsync -a --delete "$BACKUP_DIR/getsrv.app-www/" /var/www/getsrv.app/
sudo chown -R www-data:www-data /var/www/getsrv.app
sudo nginx -t
sudo systemctl reload nginx

Then debug the project copy separately.

Minimal health check

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
sudo ss -lntp | grep -E ':(443|7443|10443|11443)\b'

If these results are correct, the basic site layer is healthy.