vhost中conf的问题
来源:2-17 nginx反向代理服务器域名解析配置实操(linux系统同学看这节)
张建坤
2017-05-02
[emerg] "server" directive is not allowed here in /usr/local/nginx/conf/vhost/www.imooc.com.conf:1
提示这个
以下是配置文件,请各位帮忙看看是怎么回事。
server {
listen 80;
autoindex on;
server_name www.imooc.com;
access_log /usr/local/nginx/logs/access.log combined;
index index.html index.htm index.jsp index.php;
#error_page 404 /404.html;
if ( $query_string ~* ".*[\;'\<\>].*" ){
return 404;
}
location / {
proxy_pass http://127.0.0.1:8080;
add_header Access-Control-Allow-Origin '*';
}
}
2回答
-
hi 同学你好,应该是放置了重复的配置文件,我看你的配置ok,提示第一行,也就是server的拼写也没有问题。
请参考这两个url解决问题
http://ask.csdn.net/questions/189734
http://www.tuicool.com/articles/Rj22Ybf
022017-05-03 -
Geely
2017-05-02
先尝试解决一下,然后把具体的配置 包括nginx的主配置等,都粘贴进来,记得使用咱们提问问题的代码块哈,这样有排版,容易看。
022018-06-02
相似问题