Home >Backend Development >PHP Tutorial >nginx study notes
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>
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>
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.