SS
Size: a a a
SS
КМ
КМ
// edit virtualhost /etc/nginx/conf.d/name_virtualhost_file
server {
.. something params ...
location / {
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
}
}
// and add line to /etc/nginx/fastcgi_params
fastcgi_param PATH_INFO $fastcgi_script_name;
server {
listen 80;
index index.php index.html;
server_name project-1.localhost;
error_log /var/log/nginx/project-1.error.log;
access_log /var/log/nginx/project-1.access.log combined if=$loggable;
root /var/www/project-1.ru;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php-7.3:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
}
}
server {
listen 80;
index index.php index.html;
server_name antiperekup.localhost;
error_log /var/log/nginx/antiperekup.error.log;
access_log /var/log/nginx/antiperekup.access.log combined if=$loggable;
root /var/www/antiperekup;
location /api/ {
rewrite ^/api/(.*)$ /api.php$1;
}
location ~ /api/(.+)\.php {
fastcgi_pass php-7.3:9000;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param X_REQUEST_ID $request_id;
fastcgi_param X_FORWARDED_PROTO $scheme;
fastcgi_read_timeout 180;
fastcgi_send_timeout 180;
include fastcgi_params;
}
location ~ \.php {
fastcgi_pass php-7.3:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}
}
Server::create('/v1/', new \Api)
->addGetRoute('test_report', 'testReport')
->run();
A
location ~ \.php
“обращается” к файлу/var/www/antiperekup
/api.phpv1/test_report/?key=1321s5d6asd54 КМ
КМ
КМ
КМ
КМ
КМ
КМ
AN
AN