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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:26:10+00:00 2026-05-25T23:26:10+00:00

I have a asp.net website and i have nice urls so the user may

  • 0

I have a asp.net website and i have nice urls so the user may see /abc/1/a.jpg the path is docroot/abc/number/number/id.jpg

I need asp.net to decode where the real path is. So essentially i do it and instead of rewriting i set the X-Accel-Redirect header and called Reponse.End(); I got a 404 error. This code was in Application_BeginRequest. I tried not doing .End() and just return. I get a asp.net like 404 error. I messed around and gave up so instead of sending the header i called HttpContext.Current.RewritePath to the exact same path. The image now displays but its being handled by asp.net instead of nginx.

How do i get nginx to listen to my X-Accel-Redirect headers? What do i need in my config file? my current one looks like this

Note that i am in fact putting everything through asp.net.

server {
    server_name www.MYSITE.com static.MYSITE.com;

    root /var/www/MYSITE;

    location / {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}
  • 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-25T23:26:10+00:00Added an answer on May 25, 2026 at 11:26 pm

    gah. The problem was nginx config file. I needed to add

    location /base/path {
        internal;
    }
    

    The file must be in a directory/location that is marked internal; I notice the content type is incorrect unless set to “”. Heres what i did and i am not sure you need the first line

    HttpContext.Current.Response.ClearHeaders();
    HttpContext.Current.Response.ContentType = "";
    HttpContext.Current.Response.AddHeader("X-Accel-Redirect", full);
    HttpContext.Current.Response.End();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an asp.net website that allows the user to download largish files -
I have asp.net mvc website and in some pages i need a paging feature,
I have Asp.net website for domain A users with the Integrated Windows Authentication. Now
We have a ASP.NET website project. In the past, we had been using asmx
I have a asp.net website with a logo. When I go on facebook or
I have a ASP.NET website deployed to IIS with a couple of ashx that
I have a asp.net website in my local IIS and one of a page
I have an ASP.NET website containing the following <asp:UpdatePanel ID=UpdatePanel1 runat=server > <ContentTemplate> <asp:Label
I have an asp.net website (SQL Server, Windows 2003, IIS 6) and I am
I have a ASP.NET website deployed under IIS uisng virtual directories. I'm using forms

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.