由于缺less正斜杠,JS和CSS文件无法加载

我的客户转移到新的服务器nginx&percona服务器。 问题是正在从URL的末尾删除正斜杠。 正如你在图片中看到的那样:

在这里输入图像说明

因此,devise文件,如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; } 

在数据库中,您需要findhttp://srvlist.ukfast.net&#x7684;每个条目,并用http://srvlist.ukfast.net/ < – 添加尾部斜线

只是为了澄清,将有更多的域名条目比你在数据库中发现的更新,当你例如已经改变了在testing服务器或开发人员域的情况下运行的域名,所有的域名必须更新最后有一个斜线。