Open roukmoute opened 1 year ago
Looks like you are using a Front Controller (index.php).
Here are some examples: https://github.com/TechEmpower/FrameworkBenchmarks/tree/master/frameworks/PHP/php-ngx/deploy
There a lot of ways to do it.
I'll create an example for a Front Controller (when I have free time)
It is a Front Controller that is used to take any "route" and redirect it to index.php, and currently I don't know how to do it.
For example, how concatenate index.php with its optionnal GET arguments?
I know the repository you sent me, but this is perfect example of non applicable because all routes is hard coded.
@roukmoute It's route anything.
server {
listen 80;
server_name localhost;
access_log logs/cp-stats-web.access.log ;
root /home/mbxps/mbxps/develop/quanzhao/production/cp-stats-web/public;
index index.php index.html index.htm;
location = /favicon.ico {
}
location ~ ^/(echarts|antv|jquery|jqueryui|d3|nvd3|semantic|bootstrap|static)/ {
}
location ~ /clf {
proxy_pass http://10.16.172.70:8888;
}
location ~ ^(.*)$ {
content_by_php '
global $START_TIME;
$START_TIME = microtime(true);
if (!defined("APPLICATION_PATH")){
define("APPLICATION_PATH", "/home/mbxps/mbxps/develop/quanzhao/production/cp-stats-web");
}
require_once(APPLICATION_PATH."/vendor/autoload.php");
require_once(APPLICATION_PATH."/framework/Dispatch.php");
$application = new Dispatch();
$application->run();
';
}
}
Also I'm finishing and adapter for Ngx-php to use any php app, without touch 1 line of code.
I made it first for Workerman https://github.com/joanhey/AdapterMan
@rryqszq4 My email, I want to contact you. joanhey@kumbiaphp.com
@rryqszq4 My email, I want to contact you. joanhey@kumbiaphp.com
@joanhey My email is rryqszq@gmail.com
Is it possible to convert an example from standard nginx.conf like this?