1
我將nginx設置爲一種靜態文件服務器。出於某種原因,它只在123.123.123.123/或123.123.123.123時才起作用。但是,當我去123.123.123.123/static/content/或123.123.123.123/static/content/another.mp3它返回一個404找不到。這是配置文件位於/etc/nginx/sites-available
並鏈接到/etc/nginx/sites-enabled
。我真的難住爲什麼它不工作。Nginx配置文件只適用於''/'
任何指針或建議,將不勝感激。
server { listen 123.123.123.123:80; server_name ""; location/{ root /srv/homepage; index index.html; } location /static/content/ { root /srv/static/content; index song.mp3; } }
如果我的應用中有很多鏈接/靜態頁面?我是否需要爲每個人重寫網址? –