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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T17:07:22+00:00 2026-05-14T17:07:22+00:00

I would like to nginx to serve a static file from website root (

  • 0

I would like to nginx to serve a static file from website root ( : http://localhost:8080/ ) but it serves my proxy pass; it serves “/” rule instead of “= /”.

Here is what my nginx config look like :

listen 0.0.0.0:8080;
server_name localhost;

set $static_dir /path/to/static/

location = / {
  # got index.html in /path/to/static/html/index.html
  root $static_dir/html/;
}

location / {
  # ...
  proxy_pass http://app_cluster_1/;
}

Did i miss something ?

  • 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-14T17:07:23+00:00Added an answer on May 14, 2026 at 5:07 pm

    Use this one:

    location = / {
        index index.html;
    }
    
    location = /index.html {
        root /your/root/here;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Django application and I use nginx to serve static content. Unfortunately,
I would like to create a caching system that will bypass some mechanisms in
Im working on a web site that has to be reachable from many countries
For a basic CMS that does not require dynamic functionality like comments, why not
I am in need of a scalable and performant HTTP application/server that will be
I recently deployed a site http://boardlite.com . One of the tester websites http://www.gidnetwork.com/tools/gzip-test.php suggests
I'm using apache+mod_wsgi for django. And all css/js/images are served through nginx . For
I am currently working on my Wordpress blog, which is hosted on a VPS.NET
I'm about to deploy a mediumsized site powered by Django. I have a dedicated

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.