访问*.fecshotest.com所有首页时出现File not found.

问题咨询 · asaonan · 于 5年前 发布 · 1997 次阅读

服务器是使用Nginx 是第一次配置的。是下载教程里面的Nginx配置。更改成自己的文件路径和相关域名的。 网站是存放在了 /var/www/html/fechsop/目录下面 以下是Nginx的default.conf文件。



server {
    listen     80  ;
    server_name appadmin.fecshoptest.com;
    root  /var/www/html/fecshop/appadmin/web;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /var/www/web_logs/access.log wwwlogs;
    error_log  /var/www/web_logs/error.log  notice;
    location ~ \.php$ {
                        fastcgi_pass   127.0.0.1:9000;
                        fastcgi_index  index.php;
                        include fcgi.conf;
        }

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

        location ~ .*\.(js|css)?$ {
                expires      12h;
        }
        location /api {
                rewrite /api/([a-z][0-9a-z_]+)/?$ /api.php?type=$1;
         }
		


}

server {
    listen     80  ;
    server_name appfront.fecshoptest.com;
    root  /var/www/html/fecshop/appfront/web;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /var/www/web_logs/access.log wwwlogs;
    error_log  /var/www/web_logs/error.log  notice;
    location ~ \.php$ {
                        fastcgi_pass   127.0.0.1:9000;
                        fastcgi_index  index.php;
                        include fcgi.conf;
        }
    
	 location /fr/ {
                index index.php;
                if (!-e $request_filename){
                        rewrite . /fr/index.php last;
                }
	}
	 location /es/ {
                index index.php;
                if (!-e $request_filename){
                        rewrite . /es/index.php last;
                }
	}

	 location /cn/ {
                index index.php;
                if (!-e $request_filename){
                        rewrite . /cn/index.php last;
                }
        }

	 location /de/ {
                index index.php;
                if (!-e $request_filename){
                        rewrite . /de/index.php last;
                }
        }
	

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

        location ~ .*\.(js|css)?$ {
                expires      12h;
        }
        location /api {
                rewrite /api/([a-z][0-9a-z_]+)/?$ /api.php?type=$1;
         }


}



server {
    listen     80  ;
    server_name appapi.fecshoptest.com;
    root  /var/www/html/fecshop/appapi/web;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /var/www/web_logs/access.log wwwlogs;
    error_log  /var/www/web_logs/error.log  notice;
    location ~ \.php$ {
		fastcgi_pass   127.0.0.1:9000;
		fastcgi_index  index.php;
		include fcgi.conf;
	}

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

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


}


server {
    listen     80  ;
    server_name apphtml5.fecshoptest.com;
    root  /var/www/html/fecshop/apphtml5/web;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /var/www/web_logs/access.log wwwlogs;
    error_log  /var/www/web_logs/error.log  notice;
    location ~ \.php$ {
                        fastcgi_pass   127.0.0.1:9000;
                        fastcgi_index  index.php;
                        include fcgi.conf;
        }

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

        location ~ .*\.(js|css)?$ {
                expires      12h;
        }
        location /api {
                rewrite /api/([a-z][0-9a-z_]+)/?$ /api.php?type=$1;
         }
		 
		 


}



server {
    listen     80  ;
    server_name appserver.fecshoptest.com;
    root  /var/www/html/fecshop/appserver/web;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /var/www/web_logs/access.log wwwlogs;
    error_log  /var/www/web_logs/error.log  notice;
    location ~ \.php$ {
                        fastcgi_pass   127.0.0.1:9000;
                        fastcgi_index  index.php;
                        include fcgi.conf;
        }

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

        location ~ .*\.(js|css)?$ {
                expires      12h;
        }
        location /api {
                rewrite /api/([a-z][0-9a-z_]+)/?$ /api.php?type=$1;
         }
		 
		 


}


server {
        listen       80;
        listen 443 ssl;
        #ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
        #ssl_certificate ssl/market_onfancy_com.crt;
        #ssl_certificate_key ssl/server.key;
        server_name fancyecommerce.com;
        return 301 $scheme://www.fancyecommerce.com$request_uri;
}


server {
    listen       80;
    server_name rockmongo.fancyecommerce.com;
    root  /www/web/online/rockmongo-1.1.7;
    server_tokens off;
        include none.conf;
        index index.php index.html index.htm;
#       access_log /var/www/web_logs/access.log wwwlogs;
#       error_log  /var/www/web_logs/error.log  notice;
        location ~ \.php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                include fcgi.conf;
        }

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

        location ~ .*\.(js|css)?$ {
                expires      12h;
        }
        location /api {
                rewrite /api/([a-z][0-9a-z_]+)/?$ /api.php?type=$1;
         }
		 
		


}



server {
    listen       100;
    server_name 120.24.37.249;
    root  /www/web/online/fancyecommerce.com/frontend/web;
    server_tokens off;
        include none.conf;
        index index.php index.html index.htm;
#       access_log /var/www/web_logs/access.log wwwlogs;
#       error_log  /var/www/web_logs/error.log  notice;
        location ~ \.php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                include fcgi.conf;
        }

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

        location ~ .*\.(js|css)?$ {
                expires      12h;
        }
        location /api {
                rewrite /api/([a-z][0-9a-z_]+)/?$ /api.php?type=$1;
         }
		 
		


}





server {
        listen       80;
        listen 443 ssl;
        #ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
        #ssl_certificate ssl/market_onfancy_com.crt;
        #ssl_certificate_key ssl/server.key;
        server_name fecshop.com;
        return 301 $scheme://www.fecshop.com$request_uri;
}



server {
    listen     80  ;
    server_name img.fecshoptest.com;
    root  /var/www/html/fecshop/appimage/common;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /var/www/web_logs/access.log wwwlogs;
    error_log  /var/www/web_logs/error.log  notice;
    location ~ \.php$ {
                        fastcgi_pass   127.0.0.1:9000;
                        fastcgi_index  index.php;
                        include fcgi.conf;
        }
	location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
        expires      30d;
    }

}



server {
    listen     80  ;
    server_name img2.fancyecommerce.com;
    root  /var/www/html/fecshop/appimage/appadmin;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /var/www/web_logs/access.log wwwlogs;
    error_log  /var/www/web_logs/error.log  notice;
    location ~ \.php$ {
                        fastcgi_pass   127.0.0.1:9000;
                        fastcgi_index  index.php;
                        include fcgi.conf;
        }
	location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
        expires      30d;
    }

}



server {
    listen     80  ;
    server_name img3.fecshoptest.com;
    root  /var/www/html/fecshop/appimage/appfront;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /var/www/web_logs/access.log wwwlogs;
    error_log  /var/www/web_logs/error.log  notice;
    location ~ \.php$ {
                        fastcgi_pass   127.0.0.1:9000;
                        fastcgi_index  index.php;
                        include fcgi.conf;
        }
	location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
        expires      30d;
    }

}



server {
    listen     80  ;
    server_name img4.fecshoptest.com;
    root  /var/www/html/fecshop/appimage/apphtml5;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /var/www/web_logs/access.log wwwlogs;
    error_log  /var/www/web_logs/error.log  notice;
    location ~ \.php$ {
                        fastcgi_pass   127.0.0.1:9000;
                        fastcgi_index  index.php;
                        include fcgi.conf;
        }
	location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
        expires      30d;
    }

}


server {
    listen     80  ;
    server_name img5.fecshoptest.com;
    root  /var/www/html/fecshop/appimage/appserver;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /var/www/web_logs/access.log wwwlogs;
    error_log  /var/www/web_logs/error.log  notice;
    location ~ \.php$ {
                        fastcgi_pass   127.0.0.1:9000;
                        fastcgi_index  index.php;
                        include fcgi.conf;
        }
	location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
        expires      30d;
    }

}

共收到 3 条回复
Fecmall#15年前 0 个赞

首先确定nginx对应的php路径是否正确

可以在入口文件@app/web/index.php (@app泛指各个入口) 第一行做输出,然后exit退出,是否可以访问,如果不可以访问,说明nginx配置有问题

asaonan#25年前 0 个赞

@Fecshop #1楼 嗯。是配置的问题。我上面发的配置哪个地方有问题。第一次搞。

Kittyfamous#35年前 0 个赞

我也不能访问 502 bad gateway

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics