Skip to content

Commit

Permalink
fix: block robots by default
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Jan 25, 2024
1 parent a0e629e commit 1ed9b6d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 12 additions & 11 deletions Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,21 @@

{$CADDY_SERVER_EXTRA_DIRECTIVES}

header / Content-Type "text/html; charset=utf-8"
respond / `<!DOCTYPE html>
<html lang=en>
<meta charset="utf-8">
<meta name="robots" content="noindex">
<title>Welcome to Mercure</title>
<h1>Welcome to Mercure</h1>
<p>The URL of your hub is <code>/.well-known/mercure</code>.
Read the documentation on <a href="https://mercure.rocks">Mercure.rocks, real-time apps made easy</a>.`

skip_log /robots.txt
skip_log /healthz
skip_log /favicon.ico
skip_log /robots.txt

header / Content-Type "text/html; charset=utf-8"
respond / `<!DOCTYPE html>
<html lang=en>
<meta charset="utf-8">
<meta name="robots" content="noindex">
<title>Welcome to Mercure</title>
<h1>Welcome to Mercure</h1>
<p>The URL of your hub is <code>/.well-known/mercure</code>.
Read the documentation on <a href="https://mercure.rocks">Mercure.rocks, real-time apps made easy</a>.`
respond /robots.txt `User-agent: *
Disallow: /`
respond /healthz 200
respond "Not Found" 404
}
2 changes: 2 additions & 0 deletions Caddyfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@
redir / /.well-known/mercure/ui/

respond /healthz 200
respond /robots.txt `User-agent: *
Disallow: /`
respond "Not Found" 404
}

0 comments on commit 1ed9b6d

Please sign in to comment.