Magento 1.8的Nginx配置 [英] Nginx configuration with Magento 1.8

查看:110
本文介绍了Magento 1.8的Nginx配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何在Nginx服务器的配置文件中配置服务器{}吗? 我下面有这样的东西:

anybody knows how to configure server {} in configuration file of nginx server? I have something like this below:

server {
  server_name   local.com;

  root some_path;

  index index.php;

  #location / {
    #try_files $uri $uri/ index.php;
    #proxy_pass  http://127.0.0.1:9000;
  #}

  # set a nice expire for assets
  #location ~* "^.+\.(jpe?g|gif|css|png|js|ico|pdf|zip|tar|t?gz|mp3|wav|swf)$" {
  #  expires    max;
  #  add_header Cache-Control public;
  #}

  # the downloader has its own index.php that needs to be used
  #location ~* ^(/downloader|/js|/404|/report)(.*) {
  #  include fastcgi_params;
  #  fastcgi_index index.php;
  #  fastcgi_param  SCRIPT_FILENAME  $document_root$1/index.php$1;
  #  fastcgi_read_timeout 600;
  #  fastcgi_pass  127.0.0.1:9000;
  #}

  location ~* \.php {
    include               fastcgi_params;
    fastcgi_param         SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    fastcgi_read_timeout  18000;
    fastcgi_pass          127.0.0.1:9000;
  }

  #location ~* ^(/index.php)?(.*) {
  #  include               fastcgi_params;
  #  fastcgi_param         SCRIPT_FILENAME  $document_root/index.php$1;
  #  fastcgi_pass          127.0.0.1:9000;
  #  fastcgi_read_timeout  18000;
  #}

}

浏览器返回空白页,并且不执行php ...

Browser returns blank page and doesn't exec php...

在花了一些时间使用nginx配置和php东西之后,我结束了在某些情况下可以正确加载而在某些情况下却无法加​​载的网站...

After spending some time with nginx configuration and php stuff i ended on having site that in some cases load properly and in some not...

例如: 我有两个页面相同,但是由于某种原因,第一页是加载lie的魅力,第二页是部分加载的...

Ex: I have two pages that are identical, but for some reason first is loading lie a charm, and second is loading partially...

有时页面正在加载一半...

Sometimes page is loading half way...

Nginx没有记录任何东西...

Nginx isn't logging anything...

由于某种原因,当我尝试去后端时,nginx用后端URL加载前端:/

And for some reason when i try to go to backend, nginx loads frontend with backend url :/

有人可以为我提供其他magento 1.8配置吗?

Does anybody can provide me with other magento 1.8 configuration ?

推荐答案

好吧,这不是内存或数据库问题,这是... IonCube问题...我正在调试核心类,发现脚本在Enteprise上停止模块和...如果您没有安装IonCube,则只需显示空白页即可.

Ok, it wasn't memory or database issue, it was... IonCube issue... i was debuging core classes and found that script stops on Enteprise Modules and... if You don't have IonCube installed it just simply display blank page.

但是,现在Magento返回404:找不到页面...

But, now Magento returns 404: Page not found...

非常感谢您的帮助,如果您对第二期有任何建议,可以在此处发布:)

Thx, guys for help and if You have some advice on second issue fell free to post it here :)

稍加修正后:

/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';
Mage::run('', 'store'); //<-this
//Mage::run($mageRunCode, $mageRunType);

正反面正在加载,但是控制器存在问题...但不会持续很长时间!

Front and Back are loading, but there is an problem with controllers... but not for long !

A,如果我输入url/admin,nginx将返回未找到输入文件,但是当我键入index.php/admin时,它会加载...部分.这是重写和服务器变量的问题.

A and if i type in url /admin nginx will return Input file not found, but when i type index.php/admin it load... part. It's and issue with rewrite and server vars.

我赢了!没有安装iconv ...现在,除重写外,其他所有功能都可以正常工作...

I won ! iconv wasn't installed... now everything work except rewriting...

摘要: 我需要找到一种方法来正确获取index.php文件的服务器var并将index.php重写为/

SUMMARY: I need to find a way to properly get server var for index.php file and rewrite index.php to /

寻求帮助!

这篇关于Magento 1.8的Nginx配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆