Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.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
已解决的Index.html可以';在服务器上找不到Img_Html_Css_Image_Nginx_Path - Fatal编程技术网

已解决的Index.html可以';在服务器上找不到Img

已解决的Index.html可以';在服务器上找不到Img,html,css,image,nginx,path,Html,Css,Image,Nginx,Path,我在index.html文件中有这段代码 body, tw-story { background-image: url(../Images/TavernQuest/quest_back.png) ; background-size: cover; background-repeat: no-repeat no-repeat ; background-position: center center; } 我有以下文件: myFolder/Stories/index.html my

我在index.html文件中有这段代码

body, tw-story {
  background-image: url(../Images/TavernQuest/quest_back.png) ; 
  background-size: cover;
  background-repeat: no-repeat no-repeat ; background-position: center center;
}
我有以下文件:

  • myFolder/Stories/index.html
  • myFolder/Images/TavernQuest/quest_back.png
当我在本地主机上运行html时,所有的工作都很好,后台加载也很好。 但是当我把这个文件夹放在我的nginx服务器上时,这个映像就不再加载了

如果我将quest_back.png图像放在同一文件夹中:

  • myFolder/Stories/index.html
  • myFolder/Stories/quest_back.png
然后使用这个代码

body, tw-story {
     background-image: url(quest_back.png) ; 
     background-size: cover;
     background-repeat: no-repeat no-repeat ; background-position: center center;
}
一切都变得完美,我看到了背景图像

所以我想问题可能出在路径“../”中,我必须在nginx配置中添加一些东西

这是我的nginx配置

location /en {
        index index.html;
        alias /root/test/quests_files/en/Stories;
    }

我不太清楚你为什么要为大写字母上的所有文件夹命名第一个字母,你是否尝试过将文件夹名称的大小写降低,如
stories/images/tavern quest
?@Seno我现在尝试了,但没有任何变化。如果我将quest_back.png放在“myFolder”中,它也不起作用。我仍然认为问题出在后面的文件夹-../try
backgroundimage:url('../Images/TavernQuest/quest_back.png')
您没有位置块来访问
图像
目录中的文件。URI中的
指示浏览器更改URI,而不是指示服务器违反
别名
规则并访问其文档根以外的目录。@DylanAnlezark添加引号或双引号无效