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 6718085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:55:41+00:00 2026-05-26T08:55:41+00:00

I work on a virtual machine in Debian 6. I have nginx in front

  • 0

I work on a virtual machine in Debian 6. I have nginx in front to serve statics files (‘jpg,png,css,js…) and apache to run script.

But i have a problem, My assets files make a 404 error.

My nginx configuration :

server {
  listen      80;
  server_name mysite ;

  #access_log  /var/log/nginx/access.mysite.log;
  #error_log   /var/log/nginx/error.mysite.log;


  # Les requêtes sont transmises au processus Apache écoutant en local sur le port 81
  location / {
    proxy_pass         http://127.0.0.1:81/;
    include  /etc/nginx/proxy.conf;
  }

  # On remap sur la racine du domaine
  if ($host != "mysite"){
        rewrite ^(.*)$ http://mysite$1 permanent;
        break;
      }

  # On distribue les fichiers statiques directement
  location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|txt|srt|swf)$ {
    root  /home/php/mysite/public;
    #access_log  /var/log/nginx/access.mysite.log;
    #error_log   /var/log/nginx/error.mysite.log;
    expires           1d;
  }
}

And my apache configuration :

 <VirtualHost *>
        DocumentRoot /home/php/mysite/public
        ServerName mysite
        PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.9
        PassengerRuby /usr/local/bin/ruby
        RailsEnv development
        #ServerAlias
        <Directory  /home/php/mysite/public>

                #Conf Standard
                 AllowOverride All
                 Order allow,deny
                 Allow from all

        </Directory>
        TransferLog /dev/null
</VirtualHost>

My development.ru

  MySite::Application.configure do
    # Settings specified here will take precedence over those in config/application.rb

    # In the development environment your application's code is reloaded on
    # every request.  This slows down response time but is perfect for development
    # since you don't have to restart the web server when you make code changes.
    config.cache_classes = false

    # Log error messages when you accidentally call methods on nil.
    config.whiny_nils = true

    # Show full error reports and disable caching
    config.consider_all_requests_local       = true
    config.action_controller.perform_caching = false

    # Don't care if the mailer can't send
    config.action_mailer.raise_delivery_errors = false

    # Print deprecation notices to the Rails logger
    config.active_support.deprecation = :log

    # Only use best-standards-support built into browsers
    config.action_dispatch.best_standards_support = :builtin

    # Do not compress assets
    config.assets.compress = false

    # Expands the lines which load the assets
    config.assets.debug = true

  end

I use rails 3.1.1 with passenger. I thin it’s really a nginx problem because when i go to http://mysite:81 (so on apache directly), everything work fine.

Thank you for help.

  • 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-26T08:55:42+00:00Added an answer on May 26, 2026 at 8:55 am

    My problem was about this in my nginx configuration

    # On distribue les fichiers statiques directement
      location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|txt|srt|swf)$ {
      root  /home/php/mysite/public;
      #access_log  /var/log/nginx/access.mysite.log;
      #error_log   /var/log/nginx/error.mysite.log;
      expires           1d;
    }
    

    So i remove it, it disables nginx to serve static file but it’s not very usefull in development mode.

    Thank you for help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Class.forName(boolean.class.getName()); This doesn't work in Java - the virtual machine slaps you with a
I have two applications running in the same java virtual machine, and both use
How does a register based virtual machine work? I am looking for introduction to
I was randomly testing std::thread in my virtual linux machine (GCC 4.4.5-Debian) with this
I prefer to my development work in a virtual machine so my computer don't
I just managed to get py2exe work on a Windows Virtual Machine but stumbled
I have a Dell Server, and a Hyper-V virtual machine where I have my
How does virtual functions work behind the scenes in Inheritance ? Does the compiler
I've setup IIS6 to work with MVC, added a new virtual web site, entry
Work on asp.net vs05. I have three type of value Like:IsDesign,IsPrinting,IsInstall they are bit

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.