nginxをロードバランサーとして活用する
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[nginx]]
*説明 [#p1572a6d]
nginxをロードバランサーとして活用するための基本的な手順で...
*設定 [#xb829d6f]
# cd /etc/nginx/
# cp -p nginx.conf nginx.conf.`date +%Y%m%d`
# vi nginx.conf
---
http {
#ロードバランサー設定
upstream backend1 { <-...
server 192.168.100.100:80;
server 192.168.100.101:80;
}
---
# cd conf.d
# cp -p default.conf default.conf.`date +%Y%m%d`
# vi default.conf
---
server{
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwar...
proxy_set_header X-Forwarded-Host $host; # オリジナ...
proxy_set_header X-Forwarded-Server $host; # プロキ...
proxy_set_header X-Real-IP $remote_addr;
location / {
#root /usr/share/nginx/html;
#index index.html index.htm;
proxy_pass http://backend1;
}
# service nginx configtest
# servcie nginx reload
*バックエンドのサーバーのapacheのログ設定 [#zaa6baa4]
# cd /etc/httpd/conf
# cp -p httpd.conf httpd.conf.`date +%Y%m%d`
# vi httpd.conf
---
#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"...
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%...
---
# service httpd configtest
# service httpd graceful
*バックエンドのサーバーのnginxのログ設定 [#je38e7c3]
# vi /etc/nginx/conf.d/realip.conf
set_real_ip_from (リバースプロキシの IP アドレス);
real_ip_header X-Forwarded-For;
# service nginx reload
終了行:
[[nginx]]
*説明 [#p1572a6d]
nginxをロードバランサーとして活用するための基本的な手順で...
*設定 [#xb829d6f]
# cd /etc/nginx/
# cp -p nginx.conf nginx.conf.`date +%Y%m%d`
# vi nginx.conf
---
http {
#ロードバランサー設定
upstream backend1 { <-...
server 192.168.100.100:80;
server 192.168.100.101:80;
}
---
# cd conf.d
# cp -p default.conf default.conf.`date +%Y%m%d`
# vi default.conf
---
server{
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwar...
proxy_set_header X-Forwarded-Host $host; # オリジナ...
proxy_set_header X-Forwarded-Server $host; # プロキ...
proxy_set_header X-Real-IP $remote_addr;
location / {
#root /usr/share/nginx/html;
#index index.html index.htm;
proxy_pass http://backend1;
}
# service nginx configtest
# servcie nginx reload
*バックエンドのサーバーのapacheのログ設定 [#zaa6baa4]
# cd /etc/httpd/conf
# cp -p httpd.conf httpd.conf.`date +%Y%m%d`
# vi httpd.conf
---
#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"...
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%...
---
# service httpd configtest
# service httpd graceful
*バックエンドのサーバーのnginxのログ設定 [#je38e7c3]
# vi /etc/nginx/conf.d/realip.conf
set_real_ip_from (リバースプロキシの IP アドレス);
real_ip_header X-Forwarded-For;
# service nginx reload
ページ名: