ip a
Распараллелить выполнение в самом воркере с помощью ReactPHP или лучше GuzzleAsync. В таком случае не придется держать 5000 воркеров именно
2. "Правильно ли" это вообще делать с помощью PHP или это все таки задача уже других языков которые умеют в параллельное выполнение, корутины? Go, NodeJs?
3. Может уже есть готовые решения в виде библиотек на PHP? Искал, но не нашел
input, textarea, select {
-webkit-appearance: none;
-moz-appearance: none;
}
version: '3'
services:
alpine-nginx:
image: nginx:stable-alpine
container_name: alpine-nginx
restart: "no"
links:
- composer-php
volumes:
- ./default.conf:/etc/nginx/conf.d/default.conf
- ./code:/code
ports:
- "80:80"
composer-php:
image: php:7-fpm
container_name: composer-php
restart: "no"
volumes:
- ./code:/code
ports:
- "9000:9000"
server {
listen 80;
listen [::]:80;
client_max_body_size 2M;
server_name domain.com admin.domain.com www.domain.com api.domain.com;
charset utf-8;
index index.php;
root /code;
gzip on;
location / {
try_files $uri $uri/ @phpindex;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass composer-php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
}
location @phpindex {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass composer-php:9000;
fastcgi_index index.php;
include fastcgi_params;
set $index_name /index.php;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME $realpath_root$index_name;
fastcgi_param SCRIPT_NAME $index_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
}
location ~ /\.ht {
deny all;
}
}
<?php
header('X-PHP-REQUEST_METHOD: ' . $_SERVER['REQUEST_METHOD']);
echo $_SERVER['REQUEST_METHOD'];
echo "\n\n"
?>
zend@zbook:~$ curl -X GET http://api.domain.com/ -d ''
GET
zend@zbook:~$ curl -X POST http://api.domain.com/ -d ''
POST
zend@zbook:~$ curl -X DELETE http://api.domain.com/user/1000
DELETE
zend@zbook:~$ curl -X OPTIONS http://api.domain.com/user/1000
OPTIONS
zend@zbook:~$ curl -X PATCH http://api.domain.com/user/1000
PATCH
zend@zbook:~$ curl -I http://api.domain.com/user/1000
HTTP/1.1 200 OK
Server: nginx/1.20.1
Date: Sun, 18 Jul 2021 18:05:05 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
X-Powered-By: PHP/7.4.21
X-PHP-REQUEST_METHOD: HEAD
zend@zbook:~$ curl -X PUT http://api.domain.com/user/1000
PUT
Privacy mode or "private browsing" or "incognito mode"[1] is a privacy feature in some web browsers to disable browsing history and the web cache. This allows a person to browse the Web without storing local data that could be retrieved at a later date. Privacy mode will also disable the storage of data in cookies and Flash cookies. This privacy protection is only on the local computing device as it is still possible to identify frequented websites by associating the IP address at the web server.
Your browser fingerprint appears to be unique among the xxx,xxx,xxx tested so far.
https://www.google.ru/complete/search?sclient=psy-ab&newwindow=1&safe=off&biw=840&bih=589&q=hello&oq=&gs_l=&pbx=1&bav=on.2,or.r_cp.&bvm=bv.150120842,d.bGs&fp=340975d5227619b6&pf=p&gs_rn=64&gs_ri=psy-ab&gs_mss=%D0%BF%D0%B0h&tok=0mPi7H_lGIpBh7dz7hlFyQ&cp=5&gs_id=24&xhr=t&tch=1&ech=15&psi=uGDSWO_2CMb-6ASvx7PoDg.1490182331198.1
http {
...
limit_req_zone $binary_remote_addr zone=reqlimit:10m rate=30r/s;
...
}
server {
...
location / {
...
limit_req zone=reqlimit burst=10 nodelay;
}
}
[Definition]
failregex = limiting requests, excess: .* by zone .*, client: <HOST>
ignoreregex =
[nginx-req-limit]
enabled = true
port = http,https
filter = nginx-req-limit
logpath = /var/www/*/*/logs/error.log # Здесь укажите свой путь к логам виртуального хоста
findtime = 600
maxretry = 10
bantime = 7200