support root and path deployments explicitly

This commit is contained in:
2026-07-10 08:47:59 +00:00
parent a6e8be7553
commit 47795011b6
8 changed files with 237 additions and 26 deletions
@@ -1,6 +1,6 @@
services:
ushort:
image: sodium/ushort:0.1.0
image: sodium/ushort:0.1.1
container_name: ushort
command: ["/app/config.toml"]
ports:
+42
View File
@@ -0,0 +1,42 @@
# URL Shortener — dedicated subdomain location blocks
# Use inside the server {} block for a host such as s.example.com. Configure
# base_url = "https://s.example.com" in config.toml.
# Preserve the no-store policy for the HTML entry point.
location = / {
proxy_pass http://127.0.0.1:18082;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_hide_header Cache-Control;
add_header Cache-Control "no-store";
}
# Preserve the revalidation policy for CSS, JavaScript, and fonts.
location ^~ /static/ {
proxy_pass http://127.0.0.1:18082;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_hide_header Cache-Control;
add_header Cache-Control "no-cache";
}
# API calls and short-code redirects.
location / {
proxy_pass http://127.0.0.1:18082;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}