nginx负载均衡
ngxin可以作为静态资源服务器,反向代理服务器,还可以虚拟主机。
nginx配置文件 /nginx/server/conf/nginx.conf
#user nobody; #代表当前配置文件的权限 通常设置为root server { listen 80; #代表监听的端口 server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { #匹配规则 一个sever下面可以有多个location root html; #root 表示根目录 /nginx/server index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 26 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; 35 # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache‘s document root 42 # concurs with nginx‘s one 43 # #location ~ /\.ht { 45 # deny all; #} }
proxy_pass 与 upstream 配合使用可以实现转发
location /group {
proxy_pass http://fdfs.com;
}
upstream fdfs.com {
server 10.130.1.101:80;
client_max_body_size 20m; #接收的最大传输大小
}
相关推荐
畅聊架构 2020-06-28
zllbirdonland 2020-06-16
swtIrene 2020-06-04
畅聊架构 2020-06-01
后厂村老司机 2020-04-19
zllbirdonland 2020-04-30
tinydu 2020-04-27
zllbirdonland 2020-04-26
yungame 2020-04-23
yungame 2020-04-21
tinydu 2020-04-18
畅聊架构 2020-03-28
畅聊架构 2020-03-26
魏莉的微 2020-02-21
tinydu 2020-02-18
魏莉的微 2020-02-10
魏莉的微 2020-01-12
畅聊架构 2020-01-03
yungame 2013-06-19