美文网首页
WordPress,Drupal,Laravel 的 NGINX

WordPress,Drupal,Laravel 的 NGINX

作者: zhang22bin | 来源:发表于2016-02-28 14:47 被阅读0次

    <pre>
    server {
    listen 80;
    server_name 你的域名;
    root 网站的根目录;
    index index.php index.html index.htm;
    location / {
    index index.php index.html index.htm;
    try_files $uri $uri/ /index.php?$query_string;
    }
    location ~ .php$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    include fastcgi.conf;
    }
    }
    </pre>

    在这个 server
    区块里面,定义了一些基本的配置,比如监听的端口号,绑定的域名,网站的根目录,默认打开的文件。
    这里一共有两个 location
    区块,第一个匹配默认的请求,第二个匹配对 PHP 的请求,有 PHP 请求,就把这些请求发送给 FastCGI 服务(PHP-FPM),地址是 127.0.0.1:9000

    相关文章

      网友评论

          本文标题:WordPress,Drupal,Laravel 的 NGINX

          本文链接:https://www.haomeiwen.com/subject/ikxgkttx.html