-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
48 lines (32 loc) · 1.2 KB
/
nginx.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
37
38
39
40
41
42
43
44
45
46
47
server {
listen 80;
server_name lenixphp.p2hp.com;
root /var/www/html/LenixPHP/public;
#add_header Access-Control-Allow-Origin *;
#add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,PATCH,OPTIONS;
# location / {
#index index.php
# try_files $uri $uri/ /index.php?$query_string;
#}
#error_page 405 =200 $uri;
location / {
index index.html index.htm index.php;
#主要是这一段一定要确保存在
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php/$1 last;
break;
}
#结束
#autoindex on;
}
location ~ \.php(.*)$ {
# fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_pass unix:/run/php/php8.0-fpm.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
}