0
這看起來很基本,但我無法解決這個問題。 我想NGINX服務於當前根外源的URL,基本符合../
如何從NGINX的根目錄以外提供相對源url
開始這是我的目錄
common
root (NGINX root)
->index.html (NGINX default index)
common (another common folder)
我希望能夠以服務
src="../common/whatever" /*outer common folder*/
src="./common" /*inner common folder; Cannot change unfortunately*/
正如你所看到的,簡單location /common
將無法正常工作。
這是我目前NGINX的conf,
server
{
listen 83 default_server;
listen [::]:83 default_server ipv6only=on;
root C:/www/root;
index index.html index.htm;
#This does not work for inner /common folder
location /common {
root C:/www;
try_files $uri /index.html;
}
location/{
try_files $uri /index.html;
}
}