Home > Backend Development > PHP Tutorial > Nginx configuration notes

Nginx configuration notes

WBOY
Release: 2016-07-28 08:27:37
Original
1130 people have browsed it

引子

本篇记录学习 nginx 的点滴

主要配置

与 PHP 整合

<code>vim nginx.conf

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

location ~ \.php {
    root /var/www/html;
    fastcgi_pass <span>127.0</span>.<span>0.1</span>:<span>9000</span>;
    fastcgi_index index.php;
    include fastcgi_params;
    <span>set</span><span>$path_info</span><span>""</span>;
    <span>set</span><span>$real_script_name</span><span>$fastcgi_script_name</span>;
    <span>if</span> (<span>$fastcgi_script_name</span> ~ <span>"^(.+?\.php)(/.+)$"</span>) {
    <span>set</span><span>$real_script_name</span><span>$1</span>;
    <span>set</span><span>$path_info</span><span>$2</span>;
    }
    fastcgi_param SCRIPT_FILENAME <span>$document_root</span><span>$real_script_name</span>;
    fastcgi_param SCRIPT_NAME <span>$real_script_name</span>;
    fastcgi_param PATH_INFO <span>$path_info</span>;
}</code>
Copy after login
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template