Files are uploaded over REST, stored on disk (a volume in Docker) and recorded on the ticket as events; the bytes are written first, so no attachment ever points at a missing file. Only images, video, audio, PDF and plain text are shown inline, everything with nosniff and a sandbox CSP. The web shows thumbnails, uploads by drag and drop or by pasting a screenshot, and attaches files to new comments. Also adds `nx run api:contracts`, which writes schema.gql and openapi.json without starting the API or any database. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
43 lines
1.3 KiB
Nginx Configuration File
43 lines
1.3 KiB
Nginx Configuration File
# Same-origin API for the SPA: REST under /api, GraphQL (HTTP + WebSocket) under /graphql.
|
|
# The API is reached by its unique alias (task-stream-api), not by the service name `api`:
|
|
# on a shared network (Dokploy) another project's `api` would get half of the requests.
|
|
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
root /usr/share/nginx/html;
|
|
|
|
location /api/ {
|
|
# Attachments: the API takes files up to ATTACHMENTS_MAX_MB (25 MB by default).
|
|
client_max_body_size 30m;
|
|
proxy_pass http://task-stream-api:3000;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
|
|
location /graphql {
|
|
proxy_pass http://task-stream-api:3000;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
proxy_set_header Host $host;
|
|
# Subscriptions keep the socket open.
|
|
proxy_read_timeout 1h;
|
|
}
|
|
|
|
# Hashed bundles can be cached forever; index.html never.
|
|
location ~* \.(js|css|woff2?|svg|png|ico)$ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location / {
|
|
add_header Cache-Control "no-cache";
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|