xiaoshen 发表于 2010-12-7 14:53:09

nginx多域名配置报错 我手工配置的conf不是用vhost

userwww www;

worker_processes 1;

error_log/home/wwwlogs/nginx_error.logcrit;

pid      /usr/local/nginx/logs/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;

events
        {
                use epoll;
                worker_connections 51200;
        }

http
        {
           include       vhost/*.conf;
}为啥这样不行呢我vhost里面是绑定域名的server
        {
                listen       80;
                server_name mzirvb.com;
                server_name www.mzirvb.com;
                index index.html index.htm index.php;
                root/home/wwwroot/mzrvb;

                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_passunix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }

                location /status {
                        stub_status on;
                        access_log   off;
                }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }

                log_formatmzirvb'$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';
                access_log/home/wwwlogs/mzirvb.logmzirvb;
        }启动之后提示# /root/lnmp restart
=========================================================================
Manager for LNMP V0.5,Written by Licess
=========================================================================
LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux
This script is a tool to Manage status of lnmp
For more information please visit http://www.lnmp.org

Usage: /root/lnmp {start|stop|reload|restart|kill|status}
=========================================================================
Reload LNMP...
Reload Nginx configure...
: could not build the server_names_hash, you should increase either server_names_hash_max_size: 512 or server_names_hash_bucket_size: 64
configuration file /usr/local/nginx/conf/nginx.conf test failed
Nginx program is reloding!
Shutting down MySQL.                                       
Starting MySQL.                                          
Shutting down php_fpmdone
Starting php_fpmdone

[ 本帖最后由 xiaoshen 于 2010-12-7 14:57 编辑 ]

licess 发表于 2010-12-7 15:30:47

回复 1# 的帖子

如果不熟悉nginx的配置文件,不要乱修改,基本上全都乱了,该有的配置没了,不该加的加了。。:(

按你现在的状况,用lnmp0.5/conf/nginx.conf覆盖nginx.conf文件,吧vhost下面的配置删除。
直接用/root/vhost.sh 按提示添加吧。
等先搞熟悉nginx配置文件了在手动添加。
页: [1]
查看完整版本: nginx多域名配置报错 我手工配置的conf不是用vhost