如何新建一个网站,沧州高端网站建设,为什么要做外贸网站,手机排行榜2021前十名今天整理了下#xff0c;在centos 7.6 系统下怎么配置多个conf文件。
step 1:在nginx.conf文件所在目录新建conf.d目录#xff0c;即mkdir conf.d#xff0c;为确保权限能够访问到 chmod 777 conf.dstep 2:编辑nginx.conf文件#xff0c;内容为#xff1a;
#user nobody…今天整理了下在centos 7.6 系统下怎么配置多个conf文件。
step 1:在nginx.conf文件所在目录新建conf.d目录即mkdir conf.d为确保权限能够访问到 chmod 777 conf.dstep 2:编辑nginx.conf文件内容为
#user nobody;
worker_processes 1;error_log /usr/local/nginx/logs/error.log;
error_log /usr/local/nginx/logs/error.log notice;
error_log /usr/local/nginx/logs/error.log info;#pid logs/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 /usr/local/nginx/logs/access.log main;sendfile on;
#tcp_nopush on;#keepalive_timeout 0;
keepalive_timeout 65;#gzip on;
include /usr/local/nginx/conf/conf.d/*.conf;}
step 3:在conf.d目录下随便写个.conf文件 内容为
upstream harbor-server{server 192.168.92.129:80;server 192.168.92.130:80;
}
server {listen 80;server_name harbor.gblfy.com;location / {proxy_pass http://harbor-server;}
}
step 4:测试下conf文件格式是否正确nginx -t
step 5:启动nginx
step 6:浏览器输入地址访问