Restarting Nginx: Nginx: [emerg] unknown directive ” ” in /etc/Nginx/sites-enabled/example.com:3
这是example.com中的代码.
server {
server_name example.com 192.168.1.88;
access_log /srv/www/example.com/logs/access.log;
error_log /srv/www/example.com/logs/error.log;
root /srv/www/example.com/public/;
location / {
index index.PHP index.html index.htm;
try_files $uri $uri/ /index.PHP?$args;
}
location ~ \.PHP${
include /etc/Nginx/fastcgi_params;
fastcgi_pass unix:/var/run/PHP5-fpm.sock;
fastcgi_index index.PHP;
fastcgi_param SCRIPT_FILENAME /srv/www/example.com/public$fastcgi_script_name;
}
location /PHPmyadmin {
root /usr/share/;
index index.PHP index.html index.htm;
location ~ ^/PHPmyadmin/(.+\.PHP)${
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/var/run/PHP5-fpm.sock;
fastcgi_index index.PHP;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/Nginx/fastcgi_params;
}
location ~* ^/PHPmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))${
root /usr/share/;
}
}
location /PHPMyAdmin {
rewrite ^/* /PHPmyadmin last;
}
}
我只是按照步骤,但它无法成功运行.
本文介绍了在配置Nginx时遇到的'unknowndirective'错误,具体表现为在example.com的配置文件中。错误出现在尝试定义一个未知指令。错误代码显示在server块和location块内,涉及PHP处理和错误日志配置。解决方案可能包括检查语法错误、确保所有指令都正确无误,并且已安装和启用必要的模块。
2万+

被折叠的 条评论
为什么被折叠?



