-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
backend.conf
executable file
·36 lines (30 loc) · 1.07 KB
/
backend.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
server {
listen 80;
server_name framework.mythical.systems;
# Root directory for PHP backend
root /var/www/html/public;
index index.php index.html index.htm;
# Location for the PHP backend (handles all /api requests and PHP files)
location /api {
try_files $uri $uri/ /index.php;
}
# General PHP script handling (via PHP-FPM)
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass mythicalclient_backend:9000; # PHP-FPM is running here
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
# Location for the frontend
location / {
proxy_pass http://mythicalclient_frontend:80; # Replace 'frontend:80' with your frontend service
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;
}
# Deny access to sensitive files
location ~ /\.(ht|git|svn) {
deny all;
}
}