2016-12-26 1 views
0

여기 내 정적 웹 사이트 디렉토리 트리 : 그것은 CSS/JS 파일을로드 할 수 없습니다 그러나봉사 HTML/CSS는/JS 파일

server { 
    listen 80; 

    root /srv/www/domain.com/website/html; 
    index index.php index.html index.htm; 

    server_name domain.com; 

    location/{ 
     try_files $uri $uri/ =404; 
    } 

    location ~ \.php$ { 
     include snippets/fastcgi-php.conf; 
     fastcgi_pass unix:/run/php/php7.0-fpm.sock; 
    } 

    location ~ /\.ht { 
     deny all; 
    } 
} 

, 그것은 404을 말한다 :

- website 
-- html 
--- index.html 
-- css 
--- styles.css 
-- js 

가 여기 내의 nginx의 설정입니다 찾을 수 없습니다. 뭐가 문제 야?

답변

2
location ~* \.(js|jpg|png|css)$ { 
     root /srv/www/domain.com/website/; 
     expires 30d; 
    } 

내 문제가 해결되었습니다.

관련 문제