beforeLocal
Some checks failed
Deploy to Server / deploy (push) Failing after 5s

This commit is contained in:
2026-05-05 00:47:39 +00:00
parent fdf2cf3659
commit 70ee32efdd
31 changed files with 1169 additions and 0 deletions

54
webmail/nginx.conf Normal file
View File

@@ -0,0 +1,54 @@
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
# Serve the React SPA on the root path
location / {
root /var/www/html/spa;
index index.html;
try_files $uri $uri/ /index.html;
}
# Proxy /api requests to the backend container
location /api/ {
proxy_pass http://api:8000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# Serve SnappyMail on /mail
location ^~ /mail/ {
alias /var/www/html/mail/;
index index.php index.html;
# Need a specific regex for PHP files inside alias
location ~ \.php$ {
if (!-f $request_filename) {
return 404;
}
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}
# Deny access to SnappyMail data folder
location ^~ /mail/data {
deny all;
}
}
}
}