ngxin应用配置
应用
server {
listen 127.0.10.1:80;
server_name app.com;
root /home/0x584A/www/app;
index index.html index.htm index.php;
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?$1 last ;
break;
}
}
location ~ ^(.+\.php)(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param TIDEWAYS_SAMPLERATE "25";
fastcgi_param PHP_VALUE "auto_prepend_file=/home/0x584A/www/xhgui/external/header.php";
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $DOCUMENT_ROOT$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $DOCUMENT_ROOT/$fastcgi_script_name;
include fastcgi_params;
}
}
xhgui
server {
listen 127.0.10.2:80;
server_name debug.com;
root /home/0x584A/www/xhgui/webroot;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ /index.php?$uri&$args;
}
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
访问配置好的页面即可。