nginx + php + https ÅäÖÃÓÃÀý
#
Æô¶¯·þÎñµÄÓû§ºÍ×é
user
lighttpd lighttpd;
#
¿ª¶àÉÙ½ø³Ì
worker_processes
2;
#
´íÎóÈÕÖ¾
error_log
/data/log/nginx/nginx_error/nginx_error.log crit;
#
pid
pid
/var/run/nginx.pid;
#
Specifies
the value for maximum file descriptors that can be opened by this
process.
worker_rlimit_nofile
51200;
events
{
use
epoll;
worker_connections
51200;
}
http
{
#
¿ªÁ½ php-cgi ·þÎñ£¬¶Ë¿ÚÁ¬½Ó·½Ê½Ëٶȿ죬socket·½Ê½Îȶ¨
#
ʹÓÃ
lighttpd µÄ spawn-fcgi ÆðµÄfast-cgi
#
weight
ÊÇÉèÖÃÈ¨ÖØ
upstream phpfastcgi
{
server
unix:/tmp/php-fastcgi0.sock weight=1;
server
unix:/tmp/php-fastcgi1.sock weight=1;
#
server 127.0.0.1:8000
weight=1;
#
server 127.0.0.1:8001 weight=1;
}
#
mime ÀàÐÍ ºÍ ĬÈÏ header-type
include
mime.types;
default_type
application/octet-stream;
#
ĬÈÏ
header-charset
charset
utf-8;
#
һЩÏÞÖÆ
server_names_hash_bucket_size
128;
client_header_buffer_size
32k;
large_client_header_buffers
4 32k;
client_max_body_size
8m;
#
sendfile
Ó¦¸ÃÊÇ lighttpd µÄ sendfile ÊÇÒ»¸öÒâ˼
sendfile
on;
tcp_nopush
on;
keepalive_timeout
60;
tcp_nodelay
on;
#
fastcgi ÅäÖÃ
fastcgi_connect_timeout
300;
fa
Ïà¹ØÎĵµ£º
ÖªµÀ²î¾àÁË£¬Å¬Á¦°É£¡
1. Which of the following will not add john to the users array?
1. $users[] = 'john';
2. array_add($users,'john');
3. array_push($users,'john');
4. $users ||= 'john';
2. What's the difference between sort(), asort() and ksort? Under what circumstances would you use each o ......
ÕýÔò±í´ïʽ×Ô¼ºÒ»Ö±²»ÊìϤ£¬Õâ2ÌìÔÚÍøÉÏÒ»Ö±¿´¹ØÓÚËüµÄÎÄÕ£¬×Ô¼º×ܽáÁ˼¸¸öº¯Êý¡£
1£®preg_match()
º¯ÊýÔÐÍ£ºint preg_match (string $pattern, string $content [, array
$matches])
preg_match
()º¯ÊýÔÚ$content×Ö·û´®ÖÐËÑË÷Óë$pattern¸ø³öµÄÕýÔò±í´ïʽÏàÆ¥ÅäµÄÄÚÈÝ¡£Èç¹ûÌṩÁË$matches£¬Ôò½«Æ¥Åä½á¹û·ÅÈëÆäÖС ......
±¾ÎÄÌṩÁË20¸ö·Ç³£ÓÐÓõÄPHPÀà¿âµÄÃû³ÆºÍÏÂÔØµØÖ·¡£Õâ20¸öPHPÀà¿â°üº¬ÁËͼ±ê¿â£¬RSS½âÎö£¬ËõÂÔͼÉú³É£¬Ö§¸¶£¬OpenID£¬Êý¾Ý¿â³é Ïó£¬PDFÉú³ÉÆ÷µÈһϵÁй¦ÄÜ¡£
ÏÂÃæÊÇһЩ·Ç³£ÓÐÓõÄPHPÀà¿â£¬ÏàÐÅÒ»¶¨¿ÉÒÔΪÄãµÄWEB¿ª·¢Ìṩ¸üºÃºÍ¸üΪ¿ìËٵķ½·¨¡£
ͼ±í¿â
ÏÂÃæµÄÀà¿â¿ÉÒÔÈÃÄãºÜ¼òµÄ´´½¨¸´ÔÓµÄͼ±íºÍͼƬ¡£µ±È»£¬ËüÃÇÐèÒªG ......
1¡¢eregÀïÃæÊDz»ÐèÒªÒ²²»ÄÜʹÓ÷ָô·ûºÍÐÞÊηûµÄ£¬ËùÒÔeregµÄ¹¦ÄܱÈpregÒªÈõÉϲ»ÉÙ¡£
¡¡¡¡2¡¢¹ØÓÚ"."£ºµãÔÚÕýÔòÀïÃæÒ»°ãÊdzýÁË»»ÐзûÒÔÍâµÄÈ«²¿×Ö·û£¬µ«ÊÇÔÚeregÀïÃæµÄ"."ÊÇÈÎÒâ×Ö·û£¬¼´°üÀ¨»»Ðзû£¡Èç¹ûÔÚpregÀïÃæÏ£Íû"."
Äܹ»°üÀ¨»»Ðзû£¬¿ÉÒÔÔÚÐÞÊηûÖÐ ......
/ ok
header('HTTP/1.1 200 OK');
//ÉèÖÃÒ»¸ö404Í·:
header('HTTP/1.1 404 Not Found');
//ÉèÖõØÖ·±»ÓÀ¾ÃµÄÖØ¶¨Ïò
header('HTTP/1.1 301 Moved Permanently');
//תµ½Ò»¸öеØÖ·
header('Location: http://www.example.org/'
);
//ÎļþÑÓ³ÙתÏò:
header('Refresh: 10; url=http://www.example.org/');
print 'Y ......