I'm having issues with web.py serving static files. It servers all my javascript/css/images just fine, with no issues, but it's returning a 404 for PHP files. If I visit the php file directly, it gives an 'input file not specified' error.
I do have PHP files configured within the virtual host on nginx, but I'm wondering if I have to do this further down the location tree also? Here is my current nginx configuration for the web.py application:
server {
listen 80;
server_name clearpoint.hyfiv.com;
error_log /home/clearpoint/http_error_log;
location / {
root /home/clearpoint;
index index.htm index.html index.php;
}
location /budget-calculator {
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/tmp/cpbc.socket;
}
location /budget-calculator/static {
alias /home/clearpoint/ClearPoint-Budget-Calc/static;
}
location /budget-calculator/static/scripts/php/~\.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/tmp/php.socket;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
the test server url for the application being built: http://clearpoint.hyfiv.com/budget-calculator/
Trying to get to the /scripts/php directory returns a 403 forbidden as expected, so the issue I think isn't that it can't find the files, it's that nginx isn't serving them as proper php.
EDIT: I rewrote the entire configuration (changed above). Now getting a 405 error, but that's progress.
EDIT AGAIN: If I manually define thge location of the scripts in the location / block and then manually set the SCRIPT_FILENAME, there are no problems.
I believe I am improperly using the $fastcgi_script_name, but at least I have a workaround while I determine the best course of action given the alias requirements.
/scripts/php
located in/budget-calculator
?scripts/php
is located at/ClearPoint-Budget-Calc/static/scripts/php
. It's finding the scripts/js folder for the javascript files with no issue. But that's why I have thealias
set up for/budget-calculator/static/
.http://clearpoint.hyfiv.com/budget-calculator/static/<any_file>.php
? Did you take a look athttp_error_log
?