Do the project today, learn to learn Nginx found is also good, speed can also, but CSS JS is not used, the original Nginx configuration requires different types of file configuration rules, it is very depressing, but think also is very reasonable. When the problem is solved, post the configuration to share.
#user nobody;
Worker_processes 1;
Error_log Logs/error.log;
PID Logs/nginx.pid;
Events {
Worker_connections 1024;
}
HTTP {
Include Mime.types;
Default_type Application/octet-stream;
#log_format Main ' $remote _addr-$remote _user [$time _local] "$request"
# ' $status $body _bytes_sent ' $http _referer '
# ' $http _user_agent ', ' $http _x_forwarded_for ';
Access_log Logs/access.log;
Sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
Keepalive_timeout 65;
#gzip on;
server {
Listen 8081 default;
server_name localhost;
CharSet Utf-8;
Location/{
Index index.php;
if (!-e $request _filename) {
#rewrite ^/myapp/(. *. ( css|js|jpg|gif|png)) $/$1 last;
Rewrite ^/(. *) $/index.php/$1;
Break
}
}
Location ~. +.php ($|/) {
Set $script $uri;
Set $path _info "/";
if ($uri ~ "^ (. +.php) (/.+)") {
Set $script $;
Set $path _info $;
}
Include fcgi.conf;
Root D:apache2.2htdocsmyblog;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php? if_rewrite=1;
Fastcgi_param path_info $path _info;
Fastcgi_param script_filename $document _root/$script;
Fastcgi_param Script_name $script;
}
Location ~*. (JPG|GIF|PNG|JS|CSS) $ {
Root D:apache2.2htdocsmyblog;
if (-f $request _filename) {
Expires Max;
Break
}
}
}
}