我使用nginx作为负载均衡器,配置为:
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
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 /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;
upstream ws {
server 10.0.9.94;
}
server {
listen 80;
location / {
proxy_pass http://ws;
}
}
}
我正在使用Nginx在负载平衡器中以及正在使用httpd在Web服务器中进行工作。
负载均衡器可以正常重定向到服务器10.0.9.94,但是某些文件不能作为下一个映像正确加载
当页面由负载均衡器加载时,该文件的路径将替换为nginx config中定义的组名而不是ip,但是如果我直接加载10.0.9.94,则正确加载 发生什么事?任何想法?是个错误?