update logic and refactor code

This commit is contained in:
2025-07-16 12:15:55 +02:00
parent ed6443347a
commit 6d055f4fad
28 changed files with 435 additions and 727 deletions

45
backend/app/nginx.conf Normal file
View File

@ -0,0 +1,45 @@
server {
listen 80;
server_name *.lxdapp.local lxdapp.local;
root /var/www/html/lxd-app/backend/app/public; # Adjust this to your Slim project's public folder
index index.php index.html index.htm;
# Reverse proxy to Vue.js for /app/ route
location ^~ /app/ {
proxy_pass http://127.0.0.1:3000/app/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
# rewrite ^/app/(/.*)$ $1 break;
}
# (Optional: Serve static assets directly if needed)
# location /app/_nuxt/ {
# proxy_pass http://127.0.0.1:3000;
# }
# Handle PHP Slim
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# Pass PHP scripts to PHP-FPM
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Static file optimization (optional)
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|otf)$ {
expires 30d;
access_log off;
}
error_log /var/log/nginx/tutorial_error.log;
access_log /var/log/nginx/tutorial_access.log;
}