I know there's something fundamental I'm doing wrong but I'm thisclose getting nginx to work for me. I have the typical set up where I want any requests to a directory, such as 'mysite.com/pages' be served by 'index.html' and any requests for '/pages/page1' to be served by page1.html. I set up a directory called '/test' which is sent to a thttpd set up that serves a cgi generated page and this works just fine.
My problem occurs when I want /test/example where 'example' should be served by thttpd through cgi. I've gotten everything from redirect loops to 'not found' reported. I've done so many restarts that I've lost track of where I am this is what I have and I hope someone can set me straight and on the right path.
This gets the proper page served from thttpd if I just do http://mysite.com/test
location /test {
proxy_pass http://127.0.0.1:8000;
}
This will get any html files I have, such as http://mysite.com/ for index or /page will retrieve page.html
location /test {
try_files $uri.html $uri/index.html =404;
}
But I'm just thoroughly messed up on how to combine the two so the first example works with index.html and other html files while serving cgi from thttpd for paths like http://test/secondlevel
My problem occurs when I want /test/example where 'example' should be served by thttpd through cgi. I've gotten everything from redirect loops to 'not found' reported. I've done so many restarts that I've lost track of where I am this is what I have and I hope someone can set me straight and on the right path.
This gets the proper page served from thttpd if I just do http://mysite.com/test
location /test {
proxy_pass http://127.0.0.1:8000;
}
This will get any html files I have, such as http://mysite.com/ for index or /page will retrieve page.html
location /test {
try_files $uri.html $uri/index.html =404;
}
But I'm just thoroughly messed up on how to combine the two so the first example works with index.html and other html files while serving cgi from thttpd for paths like http://test/secondlevel