Welcome! Log In Create A New Profile

Advanced

nginx rewrite? try_files? how to try_files if script returned nothing or 404 or whatever?

Posted by hwong 
nginx rewrite? try_files? how to try_files if script returned nothing or 404 or whatever?
November 30, 2014 06:53AM
I have two files in perl and php e.g script.pl and script.php

php is listening on 6060.

how can i make it such that if script.pl returns nothing (or zero), it will be diverted to script.php?

location ~* "^/" {
rewrite ^/(.*) /script.pl?$1;
try_files $uri /script.php?$1 /index.html;

set $server_used 127.0.0.1:6060;
proxy_pass http://$server_used;
break;
}
basically i'm clueless how i can make script.php "be tried" if script.pl returns nothing or zero or 404 or whatever? can anyone help?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 174
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