mirror of
https://github.com/ceratic/project_vollidioten_website.git
synced 2026-05-14 00:16:47 +02:00
- Created DatabaseManager component for managing database access via phpMyAdmin. - Developed LinkPlayer component to link Discord accounts with game characters, including user authentication and error handling. - Added mock data files for players, organizations, and projects to handle backend unavailability. - Implemented AuthService for managing user authentication and session checks. - Created DatabaseService to fetch and manage player, organization, and project data with fallback to mock data. - Added HTML page for handling authentication unavailability. - Developed a test script for validating Docker setup and required files.
51 lines
1.4 KiB
Nginx Configuration File
51 lines
1.4 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
location /api/ {
|
|
# Try to proxy to backend first
|
|
proxy_pass http://backend:3000;
|
|
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;
|
|
|
|
# If backend is unavailable, serve mock data
|
|
error_page 502 503 504 = @fallback;
|
|
}
|
|
|
|
location @fallback {
|
|
# Serve mock data from frontend
|
|
rewrite ^/api/(.*)$ /mock/$1 break;
|
|
try_files $uri /index.html;
|
|
|
|
# Add header to indicate mock data is being used
|
|
add_header X-Mock-Data "true";
|
|
add_header X-Backend-Status "unavailable";
|
|
}
|
|
|
|
# Handle auth endpoints
|
|
location /auth/ {
|
|
proxy_pass http://backend:3000;
|
|
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;
|
|
|
|
# Auth endpoints should fail if backend is down
|
|
error_page 502 503 504 = /auth-unavailable.html;
|
|
}
|
|
|
|
# Handle static assets
|
|
location /assets/ {
|
|
expires 1y;
|
|
add_header Cache-Control "public";
|
|
}
|
|
} |