关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

使用VPS云服务器Nginx实现动态和静态页面的分离

发布时间:2023/11/22 14:35:23
香港云服务器


 动态页面。

 样例配置如下:

 #cat /usr/local/nginx/conf/nginx.conf

 ……

 server{

 listen80;

 server_namelocalhost;

 location/{

 //识别静态页面(除了 PHP外的其他所有页面)

 roothtml;

 indexindex.html;

 }

 location~*\.php${

 //识别动态页面

 roothtml;

 fastcgi_pass127.0.0.1:9000;

 include fastcgi.conf;

 }

 }