2020-02-21-伪静态

伪静态
/archives/%post_id%.html

web01
修改

[root@web01 extra]# vim blog.conf
    server {
        listen       80;
        server_name  blog.etiantian.org;
        location / {
            root   html/blog;
            index  index.php index.html index.htm;
       if (-f $request_filename/index.html) {
           rewrite (.*) $1/index.html break;
          }
       if (-f $request_filename/index.php) {
           rewrite (.*) $1/index.php;
          }
       if (!-f $request_filename) {
           rewrite (.*) /index.php;
          }
        }
        location ~.*\.(php|php5)?$ {
        root html/blog;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.hph;
        include fastcgi.conf;
    }
}
~                                                                                                                                                                                                                                                              
~                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
~                                                                                                                                                                                                                                                              
"blog.conf" 23L, 642C written                                                                                                                                                                                                                
[root@web01 extra]# ../../sbin/nginx -t
nginx: the configuration file /application/nginx-1.16.1//conf/nginx.conf syntax is ok
nginx: configuration file /application/nginx-1.16.1//conf/nginx.conf test is successful
[root@web01 extra]# 
[root@web01 extra]# ../../sbin/nginx -s reload
[root@web01 extra]# 

浏览器显示
http://blog.etiantian.org/archives/8.html

你可能感兴趣的:(2020-02-21-伪静态)