Add staging environment configuration for Caddy, Nginx, and Traefik with updated routing and logging settings

This commit is contained in:
Jeppe Bundgaard
2026-03-18 10:32:41 +01:00
parent b3772293f3
commit db42f9ef95
4 changed files with 33 additions and 1 deletions
+27
View File
@@ -0,0 +1,27 @@
{
# Traefik terminates TLS; Caddy should serve plain HTTP internally
auto_https off
}
:80 {
encode gzip
root * /var/www/html
# CORS is handled at the edge by Traefik's headers middleware.
# Do not set or strip Access-Control-* headers here to avoid conflicts.
# PHP handling via FastCGI to php-fpm pool
php_fastcgi php-staging:9000
try_files {path} {path}/ /index.php
file_server
log {
output file /var/log/caddy/access.log {
roll_size 10MiB
roll_keep 5
roll_keep_for 720h
}
format json
}
}
+2
View File
@@ -0,0 +1,2 @@
<?php
echo "Staging environment for Nginx is up and running!";
+2 -1
View File
@@ -29,7 +29,7 @@ http:
api-preflight-io:
rule: Host(`api.truckwash.io`) && Method(`OPTIONS`)
entryPoints: [websecure]
entryPoints: [websecure, websecure-staging]
middlewares: [secure-headers]
service: noop@internal
priority: 1000
@@ -80,6 +80,7 @@ http:
accessControlAllowOriginList:
- "https://truckwash.io"
- "https://api.truckwash.io"
- "https://api.truckwash.io:4433"
- "https://web.truckwash.dk"
- "https://api.truckwash.dk"
- "https://truckwash.dk"
+2
View File
@@ -3,6 +3,8 @@ entryPoints:
address: ":80"
websecure:
address: ":443"
websecure-staging:
address: ":4433"
metrics:
address: ":9100"