我需要创建nginx.conf文件与这样的路由: /assets -静态文件,/akka -为hello-world akka webapp,/* -默认页面。我的default.conf文件如下所示:
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
upstream hello-akka{
server localhost:9000;
}
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /akka {
proxy_pass http://hello-akka;
}
location /assets {
root /var/www;
}
}
}每次重新启动nginx服务时,我都会收到以下错误消息:
nginx: [emerg] "worker_processes" directive is not allowed here in /etc/nginx/conf.d/default.conf:2
nginx: configuration file /etc/nginx/nginx.conf test failed我检查了文件本身的结构,但我找不出哪里出了问题。即使我删除了这一行,我也得到了同样的“指令是不允许的”错误,但对于其他行,如pid、事件等等。那么我该如何修复这样的错误呢?
https://stackoverflow.com/questions/47641559
复制相似问题