Mginnto在Nginx中的表现不同

时间:2015-09-19 11:38:34

标签: apache .htaccess magento nginx rewrite

一个服务器相同的源代码Magento Enterprise,如果我在发布请求后在Apache中运行它一个收到Get请求,但在nginx中不起作用,并显示找不到404的页面。

我在Firefox中使用firebug进行检查。

网址:/ customer / account / create /

点击Subbmit后重定向到

网址:/ customer / account / index / =和用户渴望的页面

但在Nginx

网址:/ customer / account / create /

点击Subbmit后重定向到

http://52.88.205.17/customer/account/createpost/ =未找到404页

Apache Server默认配置和htaccess是

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^api/rest api.php?type=rest [QSA,L]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
RewriteRule .* - [L,R=405]
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php [L]

Nginx配置

server {

        listen       80;
        server_name  http://52.88.205.17;

        location / {
        root /var/www/html/src/;
        index  index.php;

        try_files $uri $uri/ @handler;
        }

        location @handler { ## Magento uses a common front handler
        rewrite / /index.php;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
        root   /var/www/html/src/;
                }

        #location  /index.php/admin      { deny all;}

        #Disable .htaccess and Hidden Files
        location  /. { return 404;      }

        location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
        rewrite ^(.*.php)/ $1 last; }

        location ~ \.php$ {
        root           /var/www/html/src/;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
        }

0 个答案:

没有答案