nginx study notes

WBOY
Release: 2016-07-28 08:26:46
Original
955 people have browsed it

Background

nginx service configuration and usage

Process description

If the service is initiated using http://openresty.org/cn/getting-started.html.
The commands used are:
PATH=/usr/local/openresty/nginx/sbin:$PATH
export PATH
Then we start the nginx server with our config file this way:
nginx -p pwd/ -c conf/nginx.conf
The -p mainly specifies the configuration directory when nginx is started; -c specifies a configuration file for Nginx to replace the default one.
If you modify the nginx.conf file, use the following statement to reload the service.

<code>/usr/<span>local</span>/openresty/nginx/sbin/nginx <span>-s</span> reload <span>-p</span><span>`pwd`</span><span>/</span><span>-c</span> conf/nginx<span>.</span>conf</code>
Copy after login

Pay attention to the path where the command line is initiated.

Initial code for testing:

<code>worker_processes  <span>1</span>;
error_log logs/<span>error</span>.<span>log</span>;
events {
    worker_connections <span>1024</span>;
}
http {
    server {
        listen <span>8080</span>;
        location / {
            default_type <span>text</span>/html;
            content_by_lua_file /home/liujiepeng/work/test.lua;
            content_by_lua '
                <span>local</span> zlib = require <span>"zlib"</span><span>local</span> v,mv,pv=zlib.<span>version</span>()
                ngx.<span>say</span>(v .. <span>"  "</span> .. mv .. <span>"  "</span> .. pv)
                ngx.<span>say</span>(<span>"<p>hello12343, world</p>"</span>)
                ';
        }
    }
}
</code>
Copy after login

Supplementary instructions

You can ask Google for the installation and compilation of zlib, basically make, make install. The install operation is to copy the so file to the corresponding folder under nginx.

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

The above introduces the nginx study notes, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!