server {
charset utf-8;
client_max_body_size 128M;
listen 80;
listen 443 default ssl;
# ssl on;
ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/cert.key;
server_name 123;
root /var/www/html/web;
index index.php;
$cookieJar = new FileCookieJar(__DIR__.'/cookie.txt',true);
$goutteClient = new Client();
$guzzleClient = new GuzzleClient(array(
'timeout' => 60,
'cookies' =>$cookieJar
));
$goutteClient->setClient($guzzleClient);
$crawler = $goutteClient->request('GET', 'https://www.yahoo.com/news/weather/russia/moscow/moscow-2122265');
$cookie = new Cookie('flavor', 'chocolate', strtotime('+1 day'));
$cookieJar = new CookieJar();
$cookieJar->set($cookie);
// create a client and set the cookies
$client = new Client(array(), null, $cookieJar);
Symfony\Component\BrowserKit\CookieJar Object ( [cookieJar:protected] => Array ( [.yahoo.com] => Array ( [/] => Array ( [B] => Symfony\Component\BrowserKit\Cookie Object ( [name:protected] => B [value:protected] => bojr0r1d9alej&b=3&s=hc [expires:protected] => 1551790675 [path:protected] => / [domain:protected] => .yahoo.com [secure:protected] => [httponly:protected] => [rawValue:protected] => bojr0r1d9alej&b=3&s=hc ) ) ) ) )
function getTree($test){
$tree = [];
foreach ($test as $id=>&$node) {
if ($node->menu_item_parent == 0)
$tree[$node->ID] = &$node;
else
$tree[$node->menu_item_parent]['childs'][$node->ID] = &$node;
}
return $tree;
}
function getTree($test){
$tree = [];
foreach ($test as $id=>&$node) {
if ($node->menu_item_parent == 0)
$tree[$node->ID] = &$node;
else
$tree[$node->menu_item_parent] = &$node;
//$tree[$node['menu_item_parent']]['childs'][$node['ID']] = &$node;
}
return $tree;
}
function getTree($test){
$tree = [];
foreach ($test as $id=>&$node) {
if ($node->menu_item_parent == 0)
$tree[$node->ID] = &$node;
else
$tree[$node->menu_item_parent] = &$node;
//$tree[$node['menu_item_parent']]['childs'][$node['ID']] = &$node;
}
return $tree;
}
Единый HTTP/HTTPS сервер
Можно настроить единый сервер, который обслуживает как HTTP-, так и HTTPS-запросы:
server {
listen 80;
listen 443 ssl;
server_name www.example.com;
ssl_certificate www.example.com.crt;
ssl_certificate_key www.example.com.key;
...
}
И теперь https://url:port вообще перестало подключатся, a https::/url работает