I'm not sure you can mix both pretty urls and regular ones on the same virtual host.
NGINX No input file specified
I am working on a legacy project where I cannot change the paths that use the .php extension. When developing locally and using php artisian serve I can use routes such as:
Route::get('/zipcode/get-zipcode-info.php', 'Zipcodes\ZipCodeController@getZipCode');
Then the request in my browser: http://127.0.0.1:8000/zipcode/get-zipcode-info.php?zipCode=06111
This works! I was very excited.
Then I deployed the code to our test server and get: "No input file specified."
The test server is running Nginx on Ubuntu 18.04
We have not been able to figure out how to set the config for the virtual host on Nginx to be able to ignore the .php extension and pass it along as a string to the route.
listen 80;
root /var/www/html/appdev/public;
index index.php index.html index.htm;
server_name appdev.newtechautomotiveservices.com;
location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
}
Please or to participate in this conversation.