499 CLIENT CLOSED REQUEST
A non-standard status code introduced by nginx for the case when a client closes the connection while nginx is processing the request.
WHERE YEAR(l.created_at) > '2017' GROUP BY `date`;
вместо этого использовать BETWEEN, я думаю. Поиграйтесь с EXPLAIN, посмотрите как выборка происходит, используются ли индексы или нет. {
"from": 0,
"size": 10,
"query": {
"bool": {
"filter": {
"geo_distance": {
"distance": "1km",
"location": "40.5586,49.6971"
}
},
"should": {
"geo_bounding_box": {
"location": {
"top_left": "49.1248,36.9448",
"bottom_right": "29.8779,58.3725"
}
}
}
}
}
}
public function getDistance(float $latitudeFrom, float $longitudeFrom, float $latitudeTo, float $longitudeTo): int
{
$rad = M_PI / 180;
$theta = $longitudeFrom - $longitudeTo;
$dist = sin($latitudeFrom * $rad) * sin($latitudeTo * $rad) + cos($latitudeFrom * $rad) * cos($latitudeTo * $rad) * cos($theta * $rad);
return acos($dist) / $rad * 60 * 1.853;
}
fastcgi_pass unix:/var/run/php5-fpm.sock;
server {
listen 80;
set $root_path '/home/wordpress/www'; # default directory where the files will be stored and served from
root $root_path;
index index.php; # index defined to be served under directory
server_name www.blog.com;
set $skip_cache 0;
# POST requests and urls with a query string should always go to PHP
if ($request_method = POST) {
set $skip_cache 1;
}
if ($query_string != "") {
set $skip_cache 1;
}
# Don't cache uris containing the following segments
if ($request_uri ~* "/wp-admin/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml") {
set $skip_cache 1;
}
# Don't use the cache for logged in users or recent commenters
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
set $skip_cache 1;
}
location ~* \.(gif|jpg|jpeg|png|ico|bmp|wmv|3gp|avi|mpg|mpeg|mp4|flv|mp3|mid|js|css|woff|woff2|exe|eot|svg|ttf)$ {
root $root_path;
expires 14d;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
access_log off;
log_not_found off;
}
# Common deny or internal locations, to help prevent access to areas of
# the site that should not be public
location ~* wp-admin/includes { deny all; }
location ~* wp-includes/theme-compat/ { deny all; }
location ~* wp-includes/js/tinymce/langs/.*\.php { deny all; }
location /wp-content/ { internal; }
location /wp-includes/ { internal; }
# The next line protects the wp-config.php file from being accessed, but
# we need to be able to run the file for the initial site setup. Uncomment
# the next line after setup is completed and reload Nginx.
location ~* wp-config.php { deny all; }
# Prevent any potentially-executable files in the uploads directory from
# being executed by forcing their MIME type to text/plain
location ~* ^/wp-content/uploads/.*.(html|htm|shtml|php)$ {
types { }
default_type text/plain;
}
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 3600;
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
fastcgi_cache WORDPRESS;
fastcgi_cache_valid 5m;
}
}
##
# Fastcgi Params
##
fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:100m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header http_500;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
var fs = require('fs');
var httpsOptions = {
key: fs.readFileSync('/home/quotes/ssl/domain.key'),
cert: fs.readFileSync('/home/quotes/ssl/domain.crt'),
ca: fs.readFileSync('/home/quotes/ssl/gd_bundle-g2-g1.crt'),
requestCert: true,
rejectUnauthorized: false,
}
var https = require('https');
var server = https.createServer(httpsOptions, https).listen(8443);
var io = require('socket.io');
var app = io.listen(server);
location /blog {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://blog.domain.com:80;
}
server {
server_name domain.com
location /other/ {
proxy_pass http://other.domain.com/;
}
}
$questionaryObj= Questionary->getQuestionary(array(
'status' => 1,
'delete' => 0,
));
foreach($questionaryObj as $questionary) {
$clientObj= Client->getClient(array('cliendId' => $questionary->cliendId));
$serviceObj= Service->getService(array('serviceId' => $questionary->serviceId));
$meetObj= Meet->getMeet(array('meetId' => $questionary->meetId));
$userCreatedName = User->getUser(array('userCreated' => $questionary->userId));
$userDogovorName = User->getUser(array('userDogovor' => $questionary->userDogovor));
$userCompleteName = User->getUser(array('userComplete' => $questionary->userComplete));
$responceArr = array(
'name' => $clientObj->name,
'lastname' => $clientObj->lastname,
'patronymic' => $clientObj->patronymic,
'phone' => $clientObj->phone,
'serviceName' => $serviceObj->name,
'meet' => $meetObj->meet,
'wasMeet' => $meetObj->wasMeet,
'dateMeet' => $meetObj->dateMeet,
'serviceName' => $serviceObj->name
);
}