organize deployment configs and documentation

This commit is contained in:
2026-07-10 12:57:21 +00:00
parent 47795011b6
commit ff2290f0f1
14 changed files with 387 additions and 375 deletions
+18
View File
@@ -0,0 +1,18 @@
services:
ushort:
image: ushort:local
build:
context: ..
command: ["/app/config.toml"]
ports:
- "127.0.0.1:18082:8080"
volumes:
- "${USHORT_CONFIG:-../config.toml}:/app/config.toml:ro"
- ../data:/app/data
user: "${USHORT_UID:-1001}:${USHORT_GID:-1001}"
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
restart: unless-stopped
+45
View File
@@ -0,0 +1,45 @@
# URL Shortener — path-prefix deployment
# Use inside a server {} block with base_url configured for /s.
location = /s {
return 301 /s/;
}
# HTML entry point.
location = /s/ {
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";
}
# CSS, JavaScript, and fonts.
location ^~ /s/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 /s/ {
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;
}
@@ -1,8 +1,7 @@
# 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.
# URL Shortener — dedicated-subdomain deployment
# Use inside a server {} block with base_url configured for that host.
# Preserve the no-store policy for the HTML entry point.
# HTML entry point.
location = / {
proxy_pass http://127.0.0.1:18082;
proxy_http_version 1.1;
@@ -16,7 +15,7 @@ location = / {
add_header Cache-Control "no-store";
}
# Preserve the revalidation policy for CSS, JavaScript, and fonts.
# CSS, JavaScript, and fonts.
location ^~ /static/ {
proxy_pass http://127.0.0.1:18082;
proxy_http_version 1.1;