location ~ \.pl$ {
try_files $uri $uri/ index.html;
include fastcgi_params;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
/test/kareha.pl/1697812648/
render a 404 error as there is no file/directory literally called kareha.pl/1697812648/
obviously. There is, accordingly, a file called ./res/1697812648.html
that was properly created. How do I make kareha work? I'm assuming rewrites are involved, but I don't know how to do this. Here's what's in my config:
location / {
try_files $uri $uri/ $uri.html =404;
autoindex off;
}
location ~ \.pl {
gzip off;
include /etc/nginx/fastcgi_params;
fastcgi_index index.pl;
fastcgi_param SCRIPT_NAME /var/www/yourwebsitehere.com/$fastcgi_script_name;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
Not sure if hardcoding the script path is correct, but it worked for me.
location ~ \.pl(/|$) {
fastcgi_split_path_info ^(.+\.pl)(/.*)$;
try_files $uri $uri/ index.html;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
include fastcgi_params;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
server {
...
...
location ~ \.pl {
include fastcgi_params;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_split_path_info ^(.+\.pl)(.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
}
}
Very nice, now if I ever want to use Kareha with Nginx someone's done the hard work for me!