nginx basic network configuration

About nginx
nginx ( "engine x")
is written in Russian very lightweight HTTP server
is a high-performance HTTP server and reverse proxy, but also a IMAP / POP3 / SMTP proxy server.
official website: http: / /nginx.org

nginx formwork panels
-prefix = / usr / local / nginx // installation directory specified
-user = nginx // specified account name
-group = // specify a group name
-with-http_ssl_moule // supports encryption **

nginx configuration files and the directory
/ usr / local / nginx / // installation directory
conf / nginx.conf // main configuration file
html // web directory
logs // log file
sbin / nginx // startup script

nginx process management
to start the service nginx
/ usr / local / nginx / sbin / nginx
common options
-V: Checking compile parameters
-c: specify the configuration file, start the service
to view the service-related processes related processes and port information
PS the AUX | grep nginx
netstat -utnalp | grep nginx

nginx配置结构
      全局配置
      		http{
      				.....
      				server{
      						....
      						location / {
      	       }
      	 }
    }
  nginx中每一个server都是一个网站每一个网站都要写在http里面才有效
	用户认证要装包 httpd-tools

Configuration container case are as follows

		http{
				....
					server{															
						listen   80;
						server_name localhost;
						location / {
							root html;													
							index index.html index.htm;
					#用户认证
					auth_basic "auth-donain";
					auth_basic_user_file /usr/local/nginx/pass;
					}
		}
}
发布了14 篇原创文章 · 获赞 0 · 访问量 197

Guess you like

Origin blog.csdn.net/nbnbnb_/article/details/103995331