-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
33 lines (29 loc) · 980 Bytes
/
Copy pathnginx.conf
File metadata and controls
33 lines (29 loc) · 980 Bytes
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
server {
listen 80;
# This must match the folder inside your PHP container
root /var/www/html/public;
index index.php;
# 1. API BLOCK FIRST (Specific)
location /api {
# Check if file exists, otherwise send to index.php
try_files $uri $uri/ /index.php?$query_string;
fastcgi_pass api:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_param DOCUMENT_ROOT $document_root;
}
# 2. PHP HANDLER (For the actual index.php file)
location ~ \.php$ {
fastcgi_pass api:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
# 3. FRONTEND BLOCK LAST (Fallback)
location / {
proxy_pass http://web:5173;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
}