linux - nginx 服务器中未加载 magento 的设计文件

标签 linux magento nginx

我的客户端转移到了新服务器,即 nginx 和 percona 服务器。问题是正斜杠已从 url 末尾删除。正如你在图片上看到的/image/Zf1Jv.jpg

因此,诸如 js、css 文件之类的设计文件未加载,或者导致 magento 404 未找到页面。它是随机发生的。

在数据库 web/unsecure/base_url 和 web/secure/base_url 上用正斜杠设置 http://78.137.115.47.srvlist.ukfast.net/

我假设 nginx 文件有问题。重写规则可能是错误的。我已经尝试了在该网站和谷歌上找到的所有可能的方法,但没有任何效果。可能是别的东西。你能帮忙吗?

这是该域的 nginx conf 文件

# Uncomment the server definition below should you wish to
# redirect from punkyfish.com to www.punkyfish.com
#server {
#    listen 192.168.92.247;
#    server_name punkyfish.com;
#    #rewrite / $scheme://www.$host$request_uri permanent;
#}

#
# Change this backend name (and the socket pointer)
# as additional virtual hosts are added. This should
# point to the spawn-fcgi wrapper running as the
# appropriate user.
#
upstream punkyfishcombackend {
        server unix:/var/run/php-fcgi-punkyfishcom.sock;
}

server {
    listen 192.168.92.247:80;
    server_name punkyfish.com;
    root /var/www/vhosts/punkyfish.com/htdocs;

    location / {
        index index.html index.php;
        try_files $uri $uri/ @handler;
        expires 30d;
    }

    location /app/                { deny all; }
    location /includes/           { deny all; }
    location /lib/                { deny all; }
    location /media/downloadable/ { deny all; }
    location /pkginfo/            { deny all; }
    location /report/config.xml   { deny all; }
    location /var/                { deny all; }

    location  /. {
        return 404;
    }

    location @handler {
       rewrite / /index.php;
    }

    location ~ .php/ {
        rewrite ^(.*.php)/ $1 last;
    }

    include "ssl_offloading.inc";
    location ~ .php$ {
        if (!-e $request_filename) { rewrite / /index.php last; }

        expires        off;
        fastcgi_pass   punkyfishcombackend;
        fastcgi_param  HTTPS $fastcgi_https;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
#       fastcgi_param  MAGE_RUN_CODE default;
#       fastcgi_param  MAGE_RUN_TYPE store;
        include        fastcgi_params;
    }

最佳答案

这是由于 nginx 缓存了所有内容。无论我对数据库和文件的更改都没有反射(reflect)出来。我从 ngnix 缓存文件夹中清理了缓存并解决了问题。

谢谢。

关于linux - nginx 服务器中未加载 magento 的设计文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26526898/

相关文章:

amazon-web-services - 无法使用 kubernetes 与在 AWS EC2 实例中本地创建的 Pod 通信

linux - 图形化 Git 客户端

linux - 如何创建一个可以拦截所有进出网络接口(interface)的数据包的内核模块

php - 从magento安装中的php文件运行自定义sql

Magento 产品不保存

nginx - Kubernetes入口-AKS

c - BSS和数据段默认有哪些数据?

linux - GitLab : You are not allowed to access master! 将 gitlab 移动到另一台服务器后

mysql - 哪个数据库最适合 Magento

docker - 如果零停机时间容器更新有多个实例,docker-compose 网络别名如何工作?