Operation and Maintenance - Questions about nginx configuration load balancing
我想大声告诉你
我想大声告诉你 2017-06-26 10:49:55
0
1
1001

Hello:

I have now installed the owncloud service on two machines, and both are running normally. The access addresses are:

  • 192.168.0.21:8080/owncloud

  • 192.168.0.22:8080/owncloud

Then modify the nginx configuration, sudo vim /etc/nginx/sites-enabled/owncloud

upstream owncloud_upstream {
    server 192.168.0.21:8080;
    server 192.168.0.22:8080;
}

server {
    listen                90;
    server_name        owncloud_server;
    location /owncloud {
            proxy_pass    http://owncloud_upstream/owncloud;
    }
}
# sudo nginx -t       
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

# sudo nginx -s reload

Then visit http://192.168.0.21:90/owncloudThe address bar becomes http://test_upstream:8080/owncloud/

Does anyone know what's going on?

Thanks

我想大声告诉你
我想大声告诉你

reply all(1)
扔个三星炸死你

You can see if this is suitable for the adjustment returned by the owncloud system. Check the header of the browser. The configuration file is fine visually. I just don’t know if the system requires a lot of configuration during installation, or if the host is determined. Logically speaking, you can’t count it as load balancing, it can only do traffic distribution.

But that address jumped to the domain name test_upstream, where did this come from

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template