2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[備忘録] Apache+Railsの設定 - mod_proxy_balancer利用

Posted at
vhost.conf
<virtualhost *:80>
  ServerName domain.name
  DocumentRoot /path/to/rails/public
  ErrorLog /path/to/log-error.log
  SetEnvIf Request_URI "\.(gif)|(jpg)|(png)|(css)$" nolog
  CustomLog /path/to/log-error.log-access.log combined env=!nolog

  RewriteEngine On

  <Proxy balancer://rails>
    BalancerMember http://192.168.1.1:3000
    BalancerMember http://192.168.1.2:3000
  </Proxy>

  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
  RewriteRule ^/(.*)$ balancer://rails%{REQUEST_URI} [P,QSA,L]

  ProxyPass / balancer://rails/
  ProxyPassReverse / balancer://rails/
  ProxyPreserveHost on

  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>

</virtualhost>
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?