進入nginx目錄:
進入:conf配置文件目錄:
通過配置nginx.conf文件來實現負載均衡:
如果想讓哪臺服務器配置得多一些,可以用weight屬性。
已上面爲例:
默認是1,就是說server localhost:8081;的weight屬性=1.
server localhost:8082 weight=2;的話,那麼nginx分配給localhost:8082的數量就會比localhost:8081要多了。
進入nginx目錄:
進入:conf配置文件目錄:
通過配置nginx.conf文件來實現負載均衡:
如果想讓哪臺服務器配置得多一些,可以用weight屬性。
已上面爲例:
默認是1,就是說server localhost:8081;的weight屬性=1.
server localhost:8082 weight=2;的話,那麼nginx分配給localhost:8082的數量就會比localhost:8081要多了。