找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
楼主: chinanbman

nginx如下问题如何解决

[复制链接]

2

主题

17

回帖

42

积分

新手上路

积分
42
 楼主| 发表于 2016-3-5 23:07:13 | 显示全部楼层

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
把配置文件发出来吧。  
回复

使用道具 举报

55

主题

2124

回帖

4489

积分

论坛元老

积分
4489
发表于 2016-3-5 23:08:10 | 显示全部楼层

欧阳逍遥 发表于 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
}
回复

使用道具 举报

2

主题

17

回帖

42

积分

新手上路

积分
42
 楼主| 发表于 2016-3-6 16:11:01 | 显示全部楼层

chinanbman 发表于 2016-3-6 16:15

server
{
        listen 80 default; #listen end

if ( $host!= 'killxjp.com' )  if和后面括号以及变量等号这些元素都要有空格
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Discuz! X

GMT+8, 2025-2-3 00:08 , Processed in 0.014123 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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