Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用magento的每页都出现Nginx 404错误(首页除外)_Magento_Nginx_Php - Fatal编程技术网

使用magento的每页都出现Nginx 404错误(首页除外)

使用magento的每页都出现Nginx 404错误(首页除外),magento,nginx,php,Magento,Nginx,Php,我为这件事伤了脑筋。 我有magento 1.8.1并将其迁移到nginx服务器(从apache) 主页确实有效,但当我尝试转到其他页面(如类别或产品页面)时,Nginx会出现404错误。 我无法解决这个问题 我已经安装并运行了php fpm nginx version: nginx/1.1.19 及 Mynginx.conf: user www-data; worker_processes 4; pid /var/run/nginx.pid; events { worker_connecti

我为这件事伤了脑筋。 我有
magento 1.8.1
并将其迁移到nginx服务器(从apache)

主页确实有效,但当我尝试转到其他页面(如类别或产品页面)时,Nginx会出现404错误。 我无法解决这个问题

我已经安装并运行了php fpm

nginx version: nginx/1.1.19

My
nginx.conf

user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
##
# Basic Settings
##
server_tokens off;
sendfile on;
keepalive_timeout 5;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
map $scheme $fastcgi_https { ## Detect when HTTPS is used
default off;
https on;
}
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log notice;
rewrite_log on;
log_format main ?$remote_addr - $remote_user [$time_local] $request ?
??$status? $body_bytes_sent ?$http_referer? ?
??$http_user_agent? ?$http_x_forwarded_for??;
##
# Gzip Settings
##
    gzip  on;
    gzip_comp_level 2;
    gzip_proxied any;
    gzip_types      text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
server {
    listen 80 default_server;

server_name xxx.stratoserver.net www.xxx.stratoserver.net; # like ServerName in Apache
root /var/www/vhosts/path_to; # document root
autoindex off; # we don’t want users to see files in directories

#ensure sensitive files are not accessible    
location ~ (^/(app/\|includes/\|lib/\|/pkginfo/\|var/\|report/config.xml)\|/\.svn/\|/\.git/\|/.hta.+) {
deny all; }

location / {
        index index.php index.html index.htm;
        try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
        expires 30d; ## Assume all files are cachable
if ($request_filename ~* ^.*?/([^/]*?)$)
            {
                set $filename $1; 
            }

            if ($filename ~* ^.*?\.(eot)|(ttf)|(woff)$){
                add_header Access-Control-Allow-Origin *;
            }

    }

location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
    access_log        off;
    log_not_found     off;
    expires           360d;
}



  location ~* .php$ {
    if (!-e $request_filename) { rewrite / /index.php last; }
    expires off;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  #  fastcgi_param MAGE_RUN_CODE default;
    fastcgi_param MAGE_RUN_TYPE store;
    include fastcgi_params;
}

}
我的
site.conf

user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
##
# Basic Settings
##
server_tokens off;
sendfile on;
keepalive_timeout 5;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
map $scheme $fastcgi_https { ## Detect when HTTPS is used
default off;
https on;
}
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log notice;
rewrite_log on;
log_format main ?$remote_addr - $remote_user [$time_local] $request ?
??$status? $body_bytes_sent ?$http_referer? ?
??$http_user_agent? ?$http_x_forwarded_for??;
##
# Gzip Settings
##
    gzip  on;
    gzip_comp_level 2;
    gzip_proxied any;
    gzip_types      text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
server {
    listen 80 default_server;

server_name xxx.stratoserver.net www.xxx.stratoserver.net; # like ServerName in Apache
root /var/www/vhosts/path_to; # document root
autoindex off; # we don’t want users to see files in directories

#ensure sensitive files are not accessible    
location ~ (^/(app/\|includes/\|lib/\|/pkginfo/\|var/\|report/config.xml)\|/\.svn/\|/\.git/\|/.hta.+) {
deny all; }

location / {
        index index.php index.html index.htm;
        try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
        expires 30d; ## Assume all files are cachable
if ($request_filename ~* ^.*?/([^/]*?)$)
            {
                set $filename $1; 
            }

            if ($filename ~* ^.*?\.(eot)|(ttf)|(woff)$){
                add_header Access-Control-Allow-Origin *;
            }

    }

location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
    access_log        off;
    log_not_found     off;
    expires           360d;
}



  location ~* .php$ {
    if (!-e $request_filename) { rewrite / /index.php last; }
    expires off;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  #  fastcgi_param MAGE_RUN_CODE default;
    fastcgi_param MAGE_RUN_TYPE store;
    include fastcgi_params;
}

}
谁能帮我运行网站的其余部分。
phpinfo.php文件确实有效。

我也有同样的问题

使用如下链接:magento181/index.php/prodct

安装:magento181/产品


这是url重写问题。

Hi,即使我在命令行中添加index.php,它也不起作用。只有frontpage可能是这将帮助你…我禁用了重写。。。但仍然是404错误