-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.sample.conf
More file actions
26 lines (22 loc) · 1.05 KB
/
nginx.sample.conf
File metadata and controls
26 lines (22 loc) · 1.05 KB
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
server {
listen 80;
server_name example.com;
root /path/to/your/webroot; # This should be the root that contains /rw_common
# Step 1: Redirect traffic to public/ if it's not already in the URL
location ^~ /rw_common/plugins/stacks/tcms/ {
# If the request does not already include /public/
rewrite ^/rw_common/plugins/stacks/tcms/?$ /rw_common/plugins/stacks/tcms/public/ permanent;
rewrite ^/rw_common/plugins/stacks/tcms/(?!public)(.*)$ /rw_common/plugins/stacks/tcms/public/$1 last;
}
# Step 2: Internal routing within the public/ folder
location /rw_common/plugins/stacks/tcms/public/ {
index index.php;
try_files $uri $uri/ /rw_common/plugins/stacks/tcms/public/index.php?$query_string;
}
# Required PHP handling (you may need to adjust socket path or port)
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; # Update for your PHP version/socket
}
}