feat: add robots.txt and sitemap.xml

This commit is contained in:
Julian Lobbes 2023-03-14 03:55:24 +01:00
parent bd48bc87b7
commit cd02ac87fd
3 changed files with 21 additions and 1 deletions

View file

@ -13,9 +13,18 @@
}
handle_path /api/* {
reverse_proxy * portfolio-backend:3001
reverse_proxy * backend:3001
}
@robots {
method GET
path /robots.txt
path /sitemap.xml
}
handle @robots {
file_server {
root /app/robots/
}
}
handle * {

4
robots/robots.txt Normal file
View file

@ -0,0 +1,4 @@
User-agent: *
Allow: /
Sitemap: https://www.example.com/sitemap.xml

7
robots/sitemap.xml Normal file
View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/index.html</loc>
<lastmod>2023-03-14</lastmod>
</url>
</urlset>