Add fixed nginx conf and upload tweaks
This commit is contained in:
parent
53c6fad262
commit
d9208e277c
|
|
@ -0,0 +1,55 @@
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
multi_accept on;
|
||||||
|
use epoll;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
# Disable access logs for cleaner output
|
||||||
|
access_log off;
|
||||||
|
error_log /var/log/nginx/error.log warn;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
# Root is set to uploads directory
|
||||||
|
root /var/www/html/uploads;
|
||||||
|
index index.html index.htm;
|
||||||
|
|
||||||
|
# Strip /uploads/ prefix if present (from Caddy routing)
|
||||||
|
location ~ ^/uploads/(.*)$ {
|
||||||
|
rewrite ^/uploads/(.*)$ /$1 break;
|
||||||
|
try_files $uri =404;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Direct access without /uploads/ prefix
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Enable directory listing for uploads
|
||||||
|
autoindex on;
|
||||||
|
autoindex_exact_size off;
|
||||||
|
autoindex_localtime on;
|
||||||
|
|
||||||
|
# Security: deny access to database files
|
||||||
|
location ~ \.(sqlite3|db)$ {
|
||||||
|
deny all;
|
||||||
|
return 404;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Set proper MIME types for common file types
|
||||||
|
location ~* \.(jpg|jpeg|png|gif|ico|svg|pdf|zip|tar|gz|mov|mp4|avi)$ {
|
||||||
|
expires 30d;
|
||||||
|
add_header Cache-Control "public, immutable";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
multi_accept on;
|
||||||
|
use epoll;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
# Disable access logs for cleaner output
|
||||||
|
access_log off;
|
||||||
|
error_log /var/log/nginx/error.log warn;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
# Root is set to uploads directory
|
||||||
|
root /var/www/html/uploads;
|
||||||
|
index index.html index.htm;
|
||||||
|
|
||||||
|
# Strip /uploads/ prefix if present (from Caddy routing)
|
||||||
|
location ~ ^/uploads/(.*)$ {
|
||||||
|
rewrite ^/uploads/(.*)$ /$1 break;
|
||||||
|
try_files $uri =404;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Direct access without /uploads/ prefix
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Enable directory listing for uploads
|
||||||
|
autoindex on;
|
||||||
|
autoindex_exact_size off;
|
||||||
|
autoindex_localtime on;
|
||||||
|
|
||||||
|
# Security: deny access to database files
|
||||||
|
location ~ \.(sqlite3|db)$ {
|
||||||
|
deny all;
|
||||||
|
return 404;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Set proper MIME types for common file types
|
||||||
|
location ~* \.(jpg|jpeg|png|gif|ico|svg|pdf|zip|tar|gz|mov|mp4|avi)$ {
|
||||||
|
expires 30d;
|
||||||
|
add_header Cache-Control "public, immutable";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -21,6 +21,7 @@ body {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: white;
|
background: white;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
|
padding-bottom: 200px; /* Reserve space for progress bar and files */
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,11 @@ submitBtn.addEventListener('click', async () => {
|
||||||
progressContainer.style.display = 'block';
|
progressContainer.style.display = 'block';
|
||||||
progressFill.style.width = '0%';
|
progressFill.style.width = '0%';
|
||||||
progressMessage.textContent = 'Starting...';
|
progressMessage.textContent = 'Starting...';
|
||||||
|
|
||||||
|
// Scroll to progress bar so it's visible (for Google Pages iframe compatibility)
|
||||||
|
setTimeout(() => {
|
||||||
|
progressContainer.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
||||||
|
}, 100);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Create FormData
|
// Create FormData
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue