Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7531587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:12:42+00:00 2026-05-30T05:12:42+00:00

I have Rails 3.1, Unicorn and Apache setup. My Apache settings are below and

  • 0

I have Rails 3.1, Unicorn and Apache setup. My Apache settings are below and production.rb looks like this. I like using h264 streaming but since Rails is serving these video files, the Apache Mod won’t work.

DocumentRoot /blabla/current/public

RewriteEngine On
Options FollowSymLinks

<Proxy balancer://unicornservers>
  BalancerMember http://127.0.0.1:4000
</Proxy>

# Redirect all non-static requests to rails
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://unicornservers%{REQUEST_URI} [P,QSA,L]

ProxyPass / balancer://unicornservers/
ProxyPassReverse / balancer://unicornservers/
ProxyPreserveHost on

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

XSendFile On
XSendFileAllowAbove on

I have to enable serve_static_assets or I cannot download any static stuff. I have precompiled assets too but it won’t make any difference as no file is available from public directory unless Rails (Rack I guess) is doing the serving.

Should I use config.action_controller.asset_host or is there something wrong with my Apache config.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:12:44+00:00Added an answer on May 30, 2026 at 5:12 am

    I have a post for this problem (yeah it also happened to me), hope it will help.

    The key point is to remove ProxyPass / balancer://unicornservers/ pattern, because it would override your Rewrite Rule

    Here is my apache server config.

    <VirtualHost *:80>
    
      ServerName example.org
      DocumentRoot /dir/of/your/project
    
      RewriteEngine On
    
      # Redirect all non-static requests to unicorn
      RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
      RewriteRule ^/(.*)$ balancer://unicornservers%{REQUEST_URI} [P,QSA,L]
    
      <Proxy balancer://unicornservers>
        BalancerMember http://127.0.0.1:2007
      </Proxy>
    
    </VirtualHost>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rails model that looks something like this: class Recipe < ActiveRecord::Base
I have Rails 3.1.2 app with a hierarchical relationship that looks like this: Categories
I have deployed a rails app on unicorn, and am using Capistrano to manage
I have rails applications, which communicate with each other using ActiveResource. I have setup
I just started using CakePHP for a small project. I have rails experience, and
I have a rails application running on a Linux server. I would like to
I have rails 3.1.3 and formtastic 2.0.2. I'm using the most basic form you
I'm using Nginx to reverse proxy my Unicorn process for a Rails app that
I have an app that is using devise for authentication. Rails 3 on ruby
I have a rails app running on my Apache server via Passenger. Occassionally I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.