2017-03-09 78 views
0

我想要訪問可以通過http訪問的特定文件夾。如何不重定向nginx上的特定文件夾?

我使用像下面的代碼,特定的文件可以在http訪問。

但我不知道如何申請Forders。

server { 
listen 80; 
ssl off; 
server_name example.com www.example.com; 
root /var/www/example; 

location = /example1.txt{ 
    # do stuff 
} 

location/{ 
    return 301 https://$host$request_uri; 
} 

}

請讓我知道如何解決這個問題。

謝謝

回答

0

您可以使用:

location /somedir { 
       autoindex on; 
     } 
+0

您好,感謝回答。 我試圖插入如下代碼 location =/wp-content/uploads/2017/02/{ autoindex on; } 但仍然只能訪問https。 – Seomari