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

  • Home
  • SEARCH
  • 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 8241141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:44:09+00:00 2026-06-07T20:44:09+00:00

I am still learning nginx, so please bear with me if the answer is

  • 0

I am still learning nginx, so please bear with me if the answer is obvious :).

I have set up nginx in front of apache using these instructions

nginx seems to be properly processing html files, however anytime I try and access a php file I get a 404 error.

here is the nginx example.com conf file

server {
    listen 80;
    access_log /var/www/example.com/logs/nginx.access.log;
    error_log /var/www/example.com/logs/nginx.error.log;
    root /var/www/example.com/prod;
    index index.php index.html index.htm;
    server_name www.example.com example.com;
    location \ {
            try_files $uri $uri/ index.php/$uri;
    }
    location ~* ^.*\.php$ {
            if (!-f $request_filename) {
                    return 404;
            }
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $host;
            proxy_pass http://127.0.0.1:8080;
    }
    location ~ /\.(ht|git) {
            deny all;
    }
}

and here is my apache example.com conf file

<VirtualHost 123.45.67.89:8080>
    ServerName example.com
    ServerAlias www.example.com
    ServerAdmin webmaster@example.com

    #Indexes + Directory Root
    DirectoryIndex index.html index.htm index.php
    DocumentRoot /var/www/example.com/prod/

    #CGI Directory
    ScriptAlias /cgi-bin/ /var/www/example.com/prod/cgi-bin/
    <location /cgi-bin>
            Options +ExecCGI
    </location>

    #Log Files
    ErrorLog /var/www/example.com/logs/error.log
    CustomLog /var/www/example.com/logs/access.log combined

</VirtualHost>

I’ve been trying to figure out where my error is for the better part of 4 hours now. I am hoping you might be able to 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-06-07T20:44:11+00:00Added an answer on June 7, 2026 at 8:44 pm

    proxy_pass http://127.0.0.1:8080; and <VirtualHost 123.45.67.89:8080>
    doesn’t look the same.

    And nginx config looks wrong. Maybe you will have better luck if you read the official documentation.

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

Sidebar

Related Questions

I'm still learning Haskell and need help with the type inference please! Using packages
I'm still learning about DDD and I have these two (probably simple) questions: If
I am still learning the whole WCF thing, so please bear with me here.
Still learning MySQL, so bear with me. So I have two tables: leads, which
Still learning CSS so pardon if this is obvious - I am building a
Still learning JSP Web Applications here. I have been doing this for a while
I'm still learning js and trying out the Webstorm IDE, which seems sweet (including
I'm still learning Rhino mocks and have a question about it. For example -
I am still learning MySQL queries and am stuck with this one. I have
Still learning asp.net and mvc, please be gentle :) Currently setting up an MVC

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.