Score:0

Nginx location block not serving static file

cn flag

I am trying to server data from my location block.

 location ~ ^/(archivefiles) {
     root /web/htdocs/archivefiles/;
  }

When a user visits. http://www.example.com/archivefiles/sports/football/1981.pdf the page errors. I have tried the following combinations in the location block with no success.

root /web/htdocs/archivefiles;
root /web/htdocs/archivefiles/$1;
root /web/htdocs/$1;

I have looked at the documentation and it looks as if i am using everything correctly.

Michael Hampton avatar
cz flag
Why is this a regex?
Ivan Shatsky avatar
gr flag
What are you trying to achieve with that regex? Try a prefix one `location /archivefiles { root /web/htdocs; }`
djdomi avatar
za flag
What are you trying to Solve, for me it looks like the [X-And-Y-Problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem)
user3525290 avatar
cn flag
I am deleting this question. I was editing the incorrect nginx config file. I am now getting a permission issue.
djdomi avatar
za flag
update the question and show us the error
user3525290 avatar
cn flag
@djdomi I am getting a `forbidden` error. So it is a permission issue i need to work on with the system admin
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.