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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:53:08+00:00 2026-05-30T12:53:08+00:00

I have an instance of nginx running which serves several websites. The first is

  • 0

I have an instance of nginx running which serves several websites. The first is a status message on the server’s IP address. The second is an admin console on admin.domain.com. These work great. Now I’d like all other domain requests to go to a single index.php – I have loads of domains and subdomains and it’s impractical to list them all in an nginx config.

So far I’ve tried setting server_name to * but that failed as an invalid wildcard. *.* works until I add the other server blocks, then I guess it conflicts with them.

Is there a way to run a catch-all server block in nginx after other sites have been defined?

N.B. I’m not a spammer, these are genuine sites with useful content, they’re just powered by the same CMS from a database!

  • 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-30T12:53:10+00:00Added an answer on May 30, 2026 at 12:53 pm

    Change listen option to this in your catch-all server block. (Add default_server) this will take all your non-defined connections (on the specified port).

    listen       80  default_server;
    

    if you want to push everything to index.php if the file or folder does not exist;

    try_files                       $uri /$uri /index.php;
    

    Per the docs, It can also be set explicitly which server should be default, with the **default_server** parameter in the listen directive

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

Sidebar

Related Questions

I have an app running with: one instance of nginx as the frontend (serving
I have an ec2 instance running on amazon which has AMI(ami-1b814f72).Its running RedHat 4.4.4-13
I have nginx configured to proxy https traffic to an http server running on
I have a instance of Oracle Access Manager set up on Server A and
I have - for instance - an asp:FormView which supports Read, Insert, Update, Delete
I have an instance of Apache Tomcat 6.x running, and I want it to
I have an instance of the Department entity, which in turn has a relationship
We have a web service which serves small, arbitrary segments of a fixed inventory
I have installed SQL Server 2005 and now have instance name as the default
I have a website currenty running on on a aws instance, and now 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.