0

我正在尝试为 wordpress 安装 Participad,这首先需要在 yourdomain.com/etherpad/ 中安装 etherpad。我已经正确安装了 etherpad,当我通过 ssh 端口转发直接连接到它时它正在工作。但是当我在 nginx 中重新配置我的虚拟主机以添加:

location /etherpad/ {
proxy_pass http://localhost:9001/;
proxy_set_header    Host $host;
proxy_buffering     off;

然后我无法加载css文件,当我直接连接到它时,可以在/static/custom/index.css下找到它,但是通过nginx我得到一个404。所以我可以加载索引页面但没有css(而且我猜javascript也不起作用,甚至还没有尝试过。)

我习惯用 nginx 代理 /,而不是文件夹。我错过了什么?

4

1 回答 1

0

像这样在 /etc/nginx/sites-enabled/default 或 nginx.conf 中定义 js 和 css 的位置块,以您系统上的任何一个为准

    location ~ \.js$ {
    root /pathtoJSFiles;
    }       

    location ~ \.css$ {
    root /pathtoCSSFiles;
    }       
于 2013-04-16T11:55:23.967 回答