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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:47:54+00:00 2026-06-06T09:47:54+00:00

I have this configuration of nginx : server { listen 80; server_name example.com www.example.com;

  • 0

I have this configuration of nginx :

server {
    listen       80;
    server_name  example.com www.example.com;

    location = / {
            root /var/www/example.com;
            index index.php;
    }

    location / {
            root   /var/www/example.com/Drupal;
            index  index.php index.html;

            if (!-f $request_filename) {
                    rewrite  ^(.*)$  /index.php?q=$1  last;
                    break;
            }

            if (!-d $request_filename) {
                    rewrite  ^(.*)$  /index.php?q=$1  last;
                    break;
            }
    }

    location ~ \.php$ {

            set $php_root /var/www/example.com/Drupal;

            if ($request_uri ~ ^/MassMail) {
                    set $php_root /var/www/example.com/MassMail;
            }

            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            include /etc/nginx/fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $php_root$fastcgi_script_name;

    }

I have 2 app in php :

  • the first in /var/www/example.com/MassMail
  • the second in /var/www/example.com/Drupal (a Drupal blog)

my server serve right the two URL

example.com/ –> drupal blog

example.com/MassMail –> other app

but it doesn’t serve the image or the JavaScript … (error 404)

for serve img etc i have tested lot of thing like this (for example …) :

    location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {
           expires         30d;
            access_log      off;
    }

maybe missing a root directory for, but which?

  • 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-06-06T09:47:56+00:00Added an answer on June 6, 2026 at 9:47 am

    You php thinks that MassMail installed in the / (root), try to add second location for staitc files:

    location ~* ^/MassMail.+.(jpg|jpeg|gif|css|png|js|ico)$ {
               expires         30d;
                access_log      off;
               root /var/www/xxx.com/MassMail;
    }
    

    Configuration #2

    location ~* ^/(.*)/.+.(jpg|jpeg|gif|css|png|js|ico)$ {
      expires         30d;
         access_log      off;
       root /var/www/xxx.com/$1;
    }
    

    Configuration #3

    Place each app configuration in special file(example for MassMail):

    applications/massmail.conf:

      location ~ \.php$ {
    
                set $php_root /var/www/xxx.com/Drupal;
    
                if ($request_uri ~ ^/MassMail) {
                        set $php_root /var/www/xxx.com/MassMail;
                }
    
       location ~* ^/MassMail.+.(jpg|jpeg|gif|css|png|js|ico)$ {
               expires         30d;
                access_log      off;
               root /var/www/xxx.com/MassMail;
       }
    

    nginx.conf:

    .....
    include applications/massmail.conf;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use such Nginx configuration for the domain: server_name_in_redirect off; listen 80; server_name ~^(www\.)?(.+)$;
I am trying out GWT in this 'configuration': 1) I have written a server
I have this in Nginx configuration files gzip_types text/plain text/html text/css application/json application/x-javascript text/xml
In my DefaultRegistry I have this configuration: ForRequestedType<INHUnitOfWork>().CacheBy(InstanceScope.HttpContext) .TheDefault.Is.OfConcreteType<NHibernateUnitOfWork>(); At some point in the
So I have this code inside my lib/ folder: class GlobalConfig::SetHelper def self.yes_no_input(configuration) value
I have the layout of a configuration dialog in an XML like this: <?xml
I'm working in xmldataprovider and we have configuration value source this value may be
I have this array in PHP: array( [0] => array( 'username' => 'user1' )
I have a Python Tornado server sitting behind a nginx frontend. Every now and
I have Nginx as my front-end web server listening on port 80. And certain

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.