当前位置:Gxlcms > PHP教程 > Nginx配置笔记

Nginx配置笔记

时间:2021-07-01 10:21:17 帮助过:11人阅读

引子

本篇记录学习 nginx 的点滴

主要配置

与 PHP 整合

vim nginx.conf

location / {
    root   /var/www/html;
    index  index.html index.php;
    # ThinkPHP hide index.php
    try_files $uri$uri/ /index.php?s=$uri&$args;
}

location ~ \.php {
    root /var/www/html;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    include fastcgi_params;
    set$path_info"";
    set$real_script_name$fastcgi_script_name;
    if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
    set$real_script_name$1;
    set$path_info$2;
    }
    fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
    fastcgi_param SCRIPT_NAME $real_script_name;
    fastcgi_param PATH_INFO $path_info;
}

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i <= lines; i++) { $numbering.append($('
  • ').text(i)); }; $numbering.fadeIn(1700); }); });

    以上就介绍了 Nginx 配置笔记,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

  • 人气教程排行