nginx学习

一、

官方文档:http://nginx.org/cn/docs/

参考:http://my.oschina.net/duxuefeng/blog/34880

二、2014-01-14

2.1、查看nginx已安装的模块:

nginx -V 
 结果 (关于配置项的含义):
nginx version: nginx/1.2.7
built by clang 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
TLS SNI support enabled
configure arguments:
--prefix=/usr/local/Cellar/nginx/1.2.7 
--with-http_ssl_module 
--with-pcre 
--with-ipv6 
--with-cc-opt=-I/usr/local/include 
--with-ld-opt=-L/usr/local/lib 
--conf-path=/usr/local/etc/nginx/nginx.conf 
--pid-path=/usr/local/var/run/nginx.pid 
--lock-path=/usr/local/var/run/nginx.lock 
--http-client-body-temp-path=/usr/local/var/run/nginx/client_body_temp 
--http-proxy-temp-path=/usr/local/var/run/nginx/proxy_temp 
--http-fastcgi-temp-path=/usr/local/var/run/nginx/fastcgi_temp 
--http-uwsgi-temp-path=/usr/local/var/run/nginx/uwsgi_tmp 
--http-scgi-temp-path=/usr/local/var/run/nginx/scgi_temp
 2.2、重启nginx( 更多)
nginx -s reload
2.3、重启nginx前检查配置是否正确
nginx -t
或
nginx -t -c /xx/xx/xx/nginx.conf

2.4、sed换行输出结果:

cat /tmp/nginx_config.txt | sed  "s/--/\\$(echo -e '\n\r--')/g"

 

你可能感兴趣的:(nginx学习)