0
現在我正在嘗試在我的.conf文件中。如果我這樣做,沒有任何圖片顯示出來。當使用流星與MUP和NGINX時,我應該如何設置我的緩存?
location ~* \.(jpg|jpeg|png|gif|ico)$ {
expires 365d;
}
location ~* \.(pdf)$ {
expires 30d;
}
我已經對SO望着這個問題(https://stackoverflow.com/a/18039576/582309)和我使用MUP擁有它並沒有解決這個問題。
我也嘗試將根路徑包含到MUP創建的構建目錄中,但這也不起作用。此外,我從緩存中刪除了CSS和JS,因爲如果這些頁面無法正常工作,頁面將無法加載,我不確定Meteor是否已經在考慮緩存這些文件。
location ~* \.(jpg|jpeg|png|gif|ico)$ {
root /opt/give/app/programs/web.browser; //tried many combinations of the path
expires 365d;
}
location ~* \.(pdf)$ {
expires 30d;
}
這裏是.conf文件
Sites.conf GIST
https://gist.github.com/c316/9552ecdc8107334fc55d
位置具體要點其餘的GIST
https://gist.github.com/c316/4917d95cbfddd3e181ad
對此有幫助嗎? https://github.com/meteorinaction/appendices/blob/master/configuration/nginx/nginxsite.conf – Stephan 2014-12-02 15:45:09
@Stephan是你的根路徑MUP的路徑或者是你存儲你的git repo或者是其他東西? – JoshJoe 2014-12-02 15:54:27
另外,我正在運行meteor而不是僅僅根URL或/所以我不知道這是否會影響緩存。 – JoshJoe 2014-12-02 15:58:51