Add Unix socket proxying for exopages

This commit is contained in:
Anthony Wang 2022-05-16 16:40:43 -05:00
parent 80b95b12ab
commit 72cfa07c13

View file

@ -18,11 +18,11 @@ server {
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ~^(?<user>.+)\.exozy\.me;
server_name ~^(?<page>.+)\.exozy\.me;
include conf.d/ssl;
root /srv/http/pages/$user;
root /srv/http/pages/$page;
index index.html;
error_page 404 /404.html;
@ -31,6 +31,10 @@ server {
}
location / {
try_files $uri $uri.html $uri/ =404;
try_files $uri $uri.html $uri/ = @fallback;
}
location @fallback {
proxy_pass http://unix:/srv/http/pages/$page;
}
}