[Mongrel] compress and max upload size?
Xavier Noria
fxn at hashref.com
Thu Dec 7 13:03:44 EST 2006
I am using mongrel_cluster with mod_proxy_balancer and would like to
enable compression (assuming it improves throughtput) and limit file
size upload. I configured mod_deflate and LimitRequestSize in Apache,
but in my trials looks like the proxied calls bypass those directives
(the conf goes below).
Is there a way to get this?
-- fxn
# Adapt this .example locally, as usual.
#
# To be included in the main httpd.conf with a line at the bottom
like this
#
# Include /path/to/example/conf/httpd.conf
NameVirtualHost *:80
# Configure the balancer to dispatch to the Mongrel cluster.
<Proxy balancer://example_cluster>
BalancerMember http://127.0.0.1:3001
BalancerMember http://127.0.0.1:3002
BalancerMember http://127.0.0.1:3003
</Proxy>
# Setup the VirtualHost for your Rails application
<VirtualHost *:80>
ServerAdmin admin at example.com
ServerName www.example.com
ServerAlias localhost
LimitRequestSize 102400
DocumentRoot /path/to/example/public
<Directory '/path/to/example/public'>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ProxyPass / balancer://example_cluster/
ProxyPassReverse / balancer://example_cluster/
# Setup your Rewrite rules here
RewriteEngine On
# Rewrite index to check for static
RewriteRule ^/$ /index.html [QSA]
# Send all requests that are not found as existing files to the
cluster
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://example_cluster%{REQUEST_URI}
[P,QSA,L]
# Deflate
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/
css application/x-javascript
# Error logs
ErrorLog /path/to/example/log/apache_error_log
CustomLog /path/to/example/log/apache_access_log combined
</VirtualHost>
More information about the Mongrel-users
mailing list