Update dispatcharr-install.sh

This commit is contained in:
CanbiZ 2025-10-20 12:09:48 +02:00
parent 3077f8787a
commit 80fae87b51

View File

@ -80,17 +80,28 @@ server {
listen 9191; listen 9191;
server_name _; server_name _;
location / { # Serve static assets with correct MIME types
include proxy_params; location /assets/ {
proxy_pass http://127.0.0.1:5656; alias /opt/dispatcharr/frontend/dist/assets/;
expires 30d;
add_header Cache-Control "public, immutable";
# Explicitly set MIME types for webpack-built assets
types {
text/javascript js;
text/css css;
image/png png;
image/svg+xml svg svgz;
font/woff2 woff2;
font/woff woff;
font/ttf ttf;
}
} }
location /static/ { location /static/ {
alias /opt/dispatcharr/static/; alias /opt/dispatcharr/static/;
} expires 30d;
add_header Cache-Control "public, immutable";
location /assets/ {
alias /opt/dispatcharr/frontend/dist/assets/;
} }
location /media/ { location /media/ {
@ -107,6 +118,12 @@ server {
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto \$scheme; proxy_set_header X-Forwarded-Proto \$scheme;
} }
# All other requests proxy to Gunicorn
location / {
include proxy_params;
proxy_pass http://127.0.0.1:5656;
}
} }
EOF EOF
@ -118,7 +135,6 @@ msg_ok "Configured Nginx"
msg_info "Creating Services" msg_info "Creating Services"
# Create environment file for services
cat <<EOF >/opt/dispatcharr/.env cat <<EOF >/opt/dispatcharr/.env
DATABASE_URL=postgresql://${DB_USER}:${DB_PASS}@localhost:5432/${DB_NAME} DATABASE_URL=postgresql://${DB_USER}:${DB_PASS}@localhost:5432/${DB_NAME}
POSTGRES_DB=$DB_NAME POSTGRES_DB=$DB_NAME