2016-04-27 104 views
-1

有配置nginx的,當提及http://example.com/sellers 必須給從文件夾/數據/賣家 服務器在另一種情況下 - 文件夾/數據/客戶的配置Nginx的使用幾個目錄

Nginx的配置:

server { 
    listen  80; 
    server_name localhost; 
    index index.html index.htm home.html; 

    location /sellers { 
     proxy_set_header X-Real-IP $remote_addr; 
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
     proxy_set_header Host $http_host; 
     proxy_set_header X-NginX-Proxy true; 

     rewrite ^/sellers/?(.*) /$1 break; 
     root /data/sellers; 
    } 

    location/{ 
     root /data/customers; 
    } 
} 

一切正常,但並不完全正確:當訪問服務器賣家以某種方式使用index.html文件夾/data/customers/index.html 而所有其餘的文件夾/數據/賣家(這是正確的) 什麼可能是錯誤的?爲什麼nginx需要錯誤的index.html文件,儘管Georgia的其餘部分都是正確的?

+4

我投票關閉這一問題作爲題外話,因爲它不是英文。 – GolezTrol

+2

Вамвhttp://ru.stackoverflow.com/ –

+0

對不起。我現在將翻譯 –

回答

0

回答

server { 
    listen  80; 
    server_name localhost; 
    index index.html index.htm home.html; 
    root /data/customers; 

    location /sellers { 
    alias /data/sellers; 
    } 
}