Skip to content

Commit

Permalink
loadbalance
Browse files Browse the repository at this point in the history
  • Loading branch information
kaz committed Aug 21, 2021
1 parent da9f8c1 commit 99ec565
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion s1/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ sudo cp -f etc/nginx/sites-available/isucondition.conf /etc/nginx/sites-availabl
cd /home/isucon/webapp/go
go build -o isucondition

sudo systemctl restart nginx
sudo systemctl restart mariadb
sudo systemctl reload nginx
sudo systemctl restart isucondition.go


Expand Down
14 changes: 14 additions & 0 deletions s1/etc/nginx/sites-available/isucondition.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
upstream app {
server isucondition-1.t.isucon.dev:3000;
server isucondition-2.t.isucon.dev:3000;
server isucondition-3.t.isucon.dev:3000;
}

server {
listen 443 ssl http2;

Expand Down Expand Up @@ -49,6 +55,14 @@ server {
try_files $uri /index.html;
}

location /api/condition/ {
proxy_set_header Host $http_host;
limit_except GET {
proxy_pass http://app;
}
proxy_pass http://127.0.0.1:3000;
}

location @webapp {
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:3000;
Expand Down
2 changes: 1 addition & 1 deletion s2/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ sudo cp -f etc/nginx/sites-available/isucondition.conf /etc/nginx/sites-availabl
cd /home/isucon/webapp/go
go build -o isucondition

sudo systemctl restart nginx
sudo systemctl restart mariadb
sudo systemctl reload nginx
sudo systemctl restart isucondition.go


Expand Down
2 changes: 1 addition & 1 deletion s3/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ sudo cp -f etc/nginx/sites-available/isucondition.conf /etc/nginx/sites-availabl
cd /home/isucon/webapp/go
go build -o isucondition

sudo systemctl restart nginx
sudo systemctl restart mariadb
sudo systemctl reload nginx
sudo systemctl restart isucondition.go


Expand Down

0 comments on commit 99ec565

Please sign in to comment.