复制+粘贴Nginx配置,用于运行多个WP站点并且页面加载速度超慢的服务器。使用Apachebuddy.pl
来配置MSQL和Apache由于上述错误,Nginx无法重启,并且在无意中重启服务器后,出现以下错误:
错误:无法执行操作:无法通过nginxmng管理服务:(' start',' nginx')。错误:[2016-03-22 22:14:01] ERR [util_exec] proc_close()失败[' / usr / local / psa / admin / bin / nginx_control' ' - 使用退出代码[1]启动']无法启动代理服务器: / usr / local / psa / admin / sbin / nginx-config执行失败:nginx: [emerg]" default_type"指令是重复的 /etc/nginx/nginx.conf:32 nginx:配置文件 /etc/nginx/nginx.conf测试失败
这是错误的nginx.conf
#user nginx; worker_processes 1;
#error_log /var/log/nginx/error.log; #error_log /var/log/nginx/error.log notice; #error_log /var/log/nginx/error.log info;
#pid /var/run/nginx.pid;
events { worker_connections 1024; }
http { #include mime.types; default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"';
#access_log /var/log/nginx/access.log main;
sendfile on; tcp_nopush on; types_hash_max_size 2048; server_names_hash_bucket_size 64; include /etc/nginx/mime.types; default_type application/octet-stream;
keepalive_timeout 10;
tcp_nodelay on;
gzip on; gzip_vary on; gzip_proxied any; gzip_comp_level 9; gzip_buffers 16 8k; gzip_http_version 1.1; gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
#gzip_disable "MSIE [1-6]\.(?!.*SV1)"; include /etc/nginx/*.custom
server_tokens off;
location ~* .(ico|jpg|webp|jpeg|gif|css|png|js|ico|bmp|zip|woff)$ { access_log off; log_not_found off; add_header Pragma public; add_header Cache-Control "public"; expires 14d;
location ~* .(php|html)$ { access_log off; log_not_found off; add_header Pragma public; add_header Cache-Control "public"; expires 14d;
fastcgi_cache_path /dev/shm/nginx levels=1:2 keys_zone=stupidfast:16m max_size=1024m inactive=60m;
fastcgi_pass_header Set-Cookie; fastcgi_pass_header Cookie; fastcgi_ignore_headers Cache-Control Expires Set-Cookie; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_intercept_errors on; include fastcgi_params; fastcgi_no_cache $no_cache; fastcgi_cache_bypass $no_cache; fastcgi_cache drm_custom_cache; fastcgi_cache_key $server_name|$request_uri; fastcgi_cache_valid 404 60m; fastcgi_cache_valid 200 60m; fastcgi_max_temp_file_size 4m; fastcgi_cache_use_stale updating;
fastcgi_pass localhost:9000; { override global parameters e.g. worker_rlimit_nofile #include /etc/nginx/*global_params;
答案 0 :(得分:0)
错误消息非常明确。你有:
default_type application/octet-stream;
在配置文件的http
块中两次。
删除其中一个。