Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

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

$
0
0
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?

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>