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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:45:26+00:00 2026-06-12T14:45:26+00:00

I have been going at this for a day now. And I think it’s

  • 0

I have been going at this for a day now. And I think it’s time to ask for help now.

I’m moving our nagios to nginx. I have nagios running as well as a django application I recently developed. Pnp4nagios is giving me some troubles though. I have the following configuration in Nginx.

location ~ ^(/pnp4nagios/.*\.php)(.*)$ {
    root /usr/share/pnp4nagios/html;

    include /etc/nginx/fastcgi_params;
    rewrite ^/pnp4nagios/(.*)$ /$1 break;

    fastcgi_split_path_info ^(.+\.php)(.*)$;
    fastcgi_param   SCRIPT_FILENAME     /usr/share/pnp4nagios/html/$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
}

This results in this:
Folder Wrong

As you can see, pnp4nagios thinks that its index.php lives in 172.16.10.28/index.php But this isn’t true. It is a sub-page (or whatever i should call it?). I want it to point to 172.16.10.28/pnp4nagios/index.php but I have no clue how I can do this in my nginx config. I would prefer not to change anything in pnp4nagios. But if it’s only one or a few lines it’s a compromise I’m willing to make. I already have an index.php in my “root” url. That’s why I want a subfolder.

The examples that have lead me to this aproach are:
Example1
Example2

So to recap what I want (or what I think that I need) is to go from this: img src="/index.php... to img src="/pnp4nagios/index.php...

PS. I didn’t have enough points to create a pnp4nagios tag

  • 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-12T14:45:27+00:00Added an answer on June 12, 2026 at 2:45 pm

    This worked for me:

    location /pnp4nagios {
        alias /usr/share/pnp4nagios/html;
    }   
    
    location ~ ^(/pnp4nagios.*\.php)(.*)$ {
        root /usr/share/pnp4nagios/html;
        include /etc/nginx/fastcgi_params;
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    
       fastcgi_param SCRIPT_FILENAME $document_root/index.php;
        fastcgi_pass 127.0.0.1:9000; 
    
    }   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well I have been on this problem the entire day and I think that
I've been with this exception all day and now I'm going crazy, I cannot
I have been struggling with this all day and have tried going through the
I've been going around in circles for hours with this. I have a UserProfile
Can anyone help? I have been using the entity framework and its going well
This should be something simple but I've been at it for a day now
I have been going over rails scheduling tasks options and stumbled upon this piece
I've been working on this for about a day and a half now, and
Today is my first day at Python and have been going through problems. One
Similar questions have been asked before but after a day of going through the

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.