宇宙主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

欧基零壹微头条IP归属甄别会员请立即修改密码
12
返回列表 发新帖
楼主: chinanbman

nginx如下问题如何解决

[复制链接]
 楼主| 发表于 2016-3-6 16:09:27 | 显示全部楼层
出现了 [emerg] invalid condition "$host!=" in /home/wwwroot/justicexjp/vhost/killxjp.com.conf:6
发表于 2016-3-6 16:11:01 | 显示全部楼层
chinanbman 发表于 2016-3-6 16:09
出现了 [emerg] invalid condition "$host!=" in /home/wwwroot/justicexjp/vhost/killxjp.com.conf:6

/home/wwwroot/justicexjp/vhost/killxjp.com.conf
把配置文件发出来吧。  
 楼主| 发表于 2016-3-6 16:15:04 | 显示全部楼层
欧阳逍遥 发表于 2016-3-6 16:11
/home/wwwroot/justicexjp/vhost/killxjp.com.conf
把配置文件发出来吧。

server
{
        listen 80 default; #listen end
        server_name killxjp.com; #server_name end
        if ( $host!= 'killxjp.com' )
        {
        rewrite ^/(.*)$ http://killxjp.com/$1 permanent;
        }
        index index.html index.htm index.php; #index end

        set $subdomain '';
        root  /home/wwwroot/justicexjp/domain/killxjp.com/web$subdomain;
        include /home/wwwroot/justicexjp/rewrite/amh.conf; #rewrite end

        #error_page
        error_page 400 /ErrorPages/400.html;
        error_page 403 /ErrorPages/403.html;
        error_page 404 /ErrorPages/404.html;
        error_page 502 /ErrorPages/502.html;
        location ~ /ErrorPages/(400|401|403|404|405|502|503)\.html$
        {
                root /home/wwwroot/justicexjp/domain/killxjp.com/web;
        }
    location ~ .*\.php$
        {
                fastcgi_pass  unix:/tmp/php-cgi-justicexjp-killxjp.com.sock;
                fastcgi_index index.php;
                include fcgi.conf;
                fastcgi_param DOCUMENT_ROOT  /home/wwwroot/justicexjp/domain/killxjp.com/web$subdomain;
                fastcgi_param SCRIPT_FILENAME  /home/wwwroot/justicexjp/domain/killxjp.com/web$subdomain$fastcgi_script_name;
        }

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

        location ~ .*\.(js|css)$
        {
                expires      12h;
        }
access_log /home/wwwroot/justicexjp/logs/killxjp.com-access.log combined; #access_log end
        error_log /dev/null; #error_log end
}
发表于 2016-3-6 16:32:17 | 显示全部楼层
chinanbman 发表于 2016-3-6 16:15
server
{
        listen 80 default; #listen end

if ( $host!= 'killxjp.com' )  if和后面括号以及变量等号这些元素都要有空格
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|FastFib VPS论坛

GMT+8, 2024-9-20 16:44 , Processed in 0.056585 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表