Welcome! Log In Create A New Profile

Advanced

Trouble serving html or cgi

Posted by drhowarddrfine 
Trouble serving html or cgi
March 19, 2014 12:39PM
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
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 94
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready