centos 7 도 메 인 이름 설정

2241 단어 linux
nginx 프로필 편집 (자신의 프로필 찾기)
vim /usr/local/nginx/conf/nginx.conf
user root;        #   nginx     
worker_processes 2;      #  nginx   worker   :
error_log logs/error.log;#  nginx    :
pid logs/nginx.pid;      #nginx pid  
 
events {
    worker_connections  1024;    #            ,
}
 
http {
    include   mime.types;
    default_type  application/octet-stream;
 
    #    #  ,      :
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request"     '
		      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
 
    access_log logs/access.log main; 	 #      
 
    #  server          server,       
    #server1 :  ,       
    server {
        listen       80;
        server_name  www.test.com;    #      ,         ,     ,     
        charset utf8;
 
        #nginx                server_name        Welcome to nginx!  
        location / {
            root   html;
            index  index.html index.htm;
        }
	
        #         
        location /images/ {
            alias  /home/file/images/;#       alias   root,        /,            404
            autoindex on;
        }
    }
}


 、  nginx       

    #server2: ,       ,                
    server {
        listen       80;
        server_name  project.test.com;    #      ,     ,     
        charset utf8;
 
	#nginx                server_name        Welcome to nginx!  
	location / {
		root   html;
		index  index.html index.htm;
	}
	
        location /test {              
		proxy_pass http://127.0.0.1:8888/;	#  http://127.0.0.1:8888/                  ,    ip:  
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header X-Forwarded-Proto $scheme;
		proxy_set_header X-Forwarded-Port $server_port;
         }
    }


 、  

server {
        listen       80;
        server_name  www.test.com; 
        charset utf8;
	
        #         
        location /images/ {
            root /home/file/images/;#       alias   root,        /,            404
            autoindex on;
        }
    }


      https://blog.csdn.net/qq_35888875/article/details/80942813

좋은 웹페이지 즐겨찾기