Serve multisite blogs from explicit Nginx roots
Some checks are pending
Build / build (push) Waiting to run
Some checks are pending
Build / build (push) Waiting to run
This commit is contained in:
parent
b3cd8a8914
commit
64a9ce84d4
3 changed files with 64 additions and 32 deletions
|
|
@ -1,36 +1,48 @@
|
|||
map $host $blog_site {
|
||||
default research;
|
||||
research.neeldhara.blog research;
|
||||
vibes.neeldhara.blog vibes;
|
||||
puzzles.neeldhara.blog puzzles;
|
||||
reflections.neeldhara.blog reflections;
|
||||
poetry.neeldhara.blog poetry;
|
||||
reviews.neeldhara.blog reviews;
|
||||
art.neeldhara.blog art;
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name research.neeldhara.blog research.neeldhara.email _;
|
||||
root /usr/share/nginx/html/research;
|
||||
include /etc/nginx/snippets/blog-locations.conf;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
|
||||
root /usr/share/nginx/html/$blog_site;
|
||||
index index.html;
|
||||
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
|
||||
location = /nginx-health {
|
||||
access_log off;
|
||||
return 204;
|
||||
}
|
||||
|
||||
location ~* \.(?:css|js|mjs|png|jpg|jpeg|gif|svg|webp|ico|woff2?)$ {
|
||||
try_files $uri =404;
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /404.html;
|
||||
}
|
||||
listen 80;
|
||||
server_name vibes.neeldhara.blog vibes.neeldhara.email;
|
||||
root /usr/share/nginx/html/vibes;
|
||||
include /etc/nginx/snippets/blog-locations.conf;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name puzzles.neeldhara.blog puzzles.neeldhara.email;
|
||||
root /usr/share/nginx/html/puzzles;
|
||||
include /etc/nginx/snippets/blog-locations.conf;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name reflections.neeldhara.blog reflections.neeldhara.email;
|
||||
root /usr/share/nginx/html/reflections;
|
||||
include /etc/nginx/snippets/blog-locations.conf;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name poetry.neeldhara.blog poetry.neeldhara.email;
|
||||
root /usr/share/nginx/html/poetry;
|
||||
include /etc/nginx/snippets/blog-locations.conf;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name reviews.neeldhara.blog reviews.neeldhara.email;
|
||||
root /usr/share/nginx/html/reviews;
|
||||
include /etc/nginx/snippets/blog-locations.conf;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name art.neeldhara.blog art.neeldhara.email;
|
||||
root /usr/share/nginx/html/art;
|
||||
include /etc/nginx/snippets/blog-locations.conf;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue