php-micro-file-server/default.conf

26 lines
622 B
Plaintext
Raw Normal View History

2024-09-12 22:53:36 +08:00
# This is a default site configuration which will simply return 404, preventing
# chance access to any other virtualhost.
server {
listen 80;
server_name localhost;
2024-09-13 10:19:36 +08:00
port_in_redirect off;
2024-09-12 22:53:36 +08:00
root /var/www/html/public;
2024-09-12 23:34:20 +08:00
index index.php index.html index.htm index.nginx-debian.html;
2024-09-12 22:53:36 +08:00
2024-09-13 10:03:52 +08:00
# 伪静态
2024-09-13 00:27:32 +08:00
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
2024-09-12 22:53:36 +08:00
2024-09-13 10:03:52 +08:00
# 请求转发
2024-09-12 22:53:36 +08:00
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}