search

Home  >  Q&A  >  body text

Operation and Maintenance - Questions about nginx configuration load balancing

Hello:

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

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

我想大声告诉你我想大声告诉你2706 days ago1002

reply all(1)I'll reply

  • 扔个三星炸死你

    扔个三星炸死你2017-06-26 10:51:55

    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

    reply
    0
  • Cancelreply