Add missing Nginx configuration for SSL and proxy settings
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -115,15 +115,42 @@ ensure_nginx_config_mount_source() {
|
|||||||
|
|
||||||
if [ ! -f "$config_path" ]; then
|
if [ ! -f "$config_path" ]; then
|
||||||
cat > "$config_path" <<'EOF'
|
cat > "$config_path" <<'EOF'
|
||||||
fi
|
server {
|
||||||
}
|
|
||||||
|
|
||||||
server() {
|
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name _;
|
server_name _;
|
||||||
return 301 https://$host$request_uri;
|
return 301 https://$host$request_uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 443 ssl;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
ssl_certificate /etc/nginx/certs/inventarsystem.crt;
|
||||||
|
ssl_certificate_key /etc/nginx/certs/inventarsystem.key;
|
||||||
|
|
||||||
|
client_max_body_size 50M;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://app:8000;
|
||||||
|
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_read_timeout 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
location = /50x.html {
|
||||||
|
default_type text/html;
|
||||||
|
return 200 '<!doctype html><html><head><meta charset="utf-8"><title>Server Error</title></head><body><h1>Server Error</h1><p>The service is temporarily unavailable.</p></body></html>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
log_message "Recreated missing nginx config at $config_path"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
ensure_min_root_disk_space() {
|
ensure_min_root_disk_space() {
|
||||||
local available_kb available_mb
|
local available_kb available_mb
|
||||||
|
|
||||||
@@ -183,36 +210,6 @@ cleanup_docker_dangling_images() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
|
||||||
listen 443 ssl;
|
|
||||||
server_name _;
|
|
||||||
|
|
||||||
ssl_certificate /etc/nginx/certs/inventarsystem.crt;
|
|
||||||
ssl_certificate_key /etc/nginx/certs/inventarsystem.key;
|
|
||||||
|
|
||||||
client_max_body_size 50M;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_pass http://app:8000;
|
|
||||||
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_read_timeout 300;
|
|
||||||
}
|
|
||||||
|
|
||||||
error_page 500 502 503 504 /50x.html;
|
|
||||||
location = /50x.html {
|
|
||||||
default_type text/html;
|
|
||||||
return 200 '<!doctype html><html><head><meta charset="utf-8"><title>Server Error</title></head><body><h1>Server Error</h1><p>The service is temporarily unavailable.</p></body></html>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
log_message "Recreated missing nginx config at $config_path"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
Usage: $0 [options]
|
Usage: $0 [options]
|
||||||
|
|||||||
Reference in New Issue
Block a user