通过nginx,怎么配置可以直接通过ip访问系统呢
5 回复
已经是监听80端口了
upstream test{
ip_hash;
server 127.0.0.1:8080;
server 127.0.0.1:9090;
}
server {
listen 80;
server_name test;
index index.html index.htm index.php index.jsp;
location / {
index index.html index.htm index.php index.jsp;
proxy_buffer_size 64k;
proxy_buffers 32 32k;
proxy_busy_buffers_size 128k;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header HTTP_X_FORWARDED_FOR $remote_addr;
proxy_pass http://test;
error_log /home/log/nginx/test_error.log;
access_log /home/log/nginx/test_access.log main;
}
}
添加回复
请先登陆