这些来自 nginx 的 conf 文件
用户 http;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
事件{
worker_connections 1024;
# multi_accept on;
}
http {
包括 mime.types;
default_type 应用程序/八位字节流;
access_log /var/log/nginx/access.log;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
服务器{
听 80;
server_name www.fireangel.ro fireangel.ro;
access_log /var/log/nginx/localhost.access.log;
默认位置
location / {
root /var/www/html/fireangel.ro/public_html;
index index.php;
}
图像和静态内容被区别对待
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
access_log off;
expires 30d;
root /var/www/html/fireangel.ro/public_html;
}
解析/srv/http目录下的所有.php文件
location ~ .php$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass backend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/html/fireangel.ro/public_html$fastcgi_script_name;
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
禁止查看 .htaccess 和 .htpassword
location ~ /\.ht {
deny all;
}
}
上游后端{
服务器 127.0.0.1:9000;
}
}