2016-10-08 2 views
0

я использую вю JS webpack для развития, когда DEV работать бесперебойно, но, к сожалению, после сборки НПМ запуска (запуск в Nginx) Nginx не может загрузить, выглядеть так:Nginx не может загрузить CSS, JS от выхода WebPack

x GET http://localhost/static/css/app.335db141d4c13fd545c8362771dbe30a.css 
x GET http://localhost/static/js/manifest.a8a366914bb58ec98264.js 
x GET http://localhost/static/js/vendor.538766e755f95e4f1561.js 
x GET http://localhost/static/js/app.23582232aa46a8daf39d.js 
x GET http://localhost/static/js/manifest.a8a366914bb58ec98264.js 
x GET http://localhost/static/js/vendor.538766e755f95e4f1561.js 
x GET http://localhost/static/js/app.23582232aa46a8daf39d.js 

это Nginx конф:

user www-data; 
worker_processes 4; 
pid /run/nginx.pid; 

events { 
    worker_connections 768; 
    # multi_accept on; 
} 

http { 

    ## 
    # Basic Settings 
    ## 

    sendfile on; 
    tcp_nopush on; 
    tcp_nodelay on; 
    keepalive_timeout 65; 
    types_hash_max_size 2048; 
    # server_tokens off; 

    # server_names_hash_bucket_size 64; 
    # server_name_in_redirect off; 

    include /etc/nginx/mime.types; 
    default_type application/octet-stream; 

    ## 
    # SSL Settings 
    ## 

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE 
    ssl_prefer_server_ciphers on; 



    access_log /var/log/nginx/access.log; 
    error_log /var/log/nginx/error.log; 

    ## 
    # Gzip Settings 
    ## 

    gzip on; 
    gzip_disable "msie6"; 


    include /etc/nginx/conf.d/*.conf; 
    include /etc/nginx/sites-enabled/*; 
} 

это по умолчанию конф:

server { 
    listen 80 default_server; 
    listen [::]:80 default_server ipv6only=on; 

    # SSL configuration 
    # 
    # listen 443 ssl default_server; 
    # listen [::]:443 ssl default_server; 
    # 
    # Note: You should disable gzip for SSL traffic. 
    # See: https://bugs.debian.org/773332 
    # 
    # Read up on ssl_ciphers to ensure a secure configuration. 
    # See: https://bugs.debian.org/765782 
    # 
    # Self signed certs generated by the ssl-cert package 
    # Don't use them in a production server! 
    # 
    # include snippets/snakeoil.conf; 

    root /usr/share/nginx/html; 

    # Add index.php to the list if you are using PHP 
    index index.php index.html index.htm index.nginx-debian.html; 

    server_name _; 

    location/{ 
     # First attempt to serve request as file, then 
     # as directory, then fall back to displaying a 404. 
     try_files $uri $uri/ /index.php; 
     } 
     error_page 404 /404.html; 
     error_page 500 502 503 504 /50x.html; 
     location = /50x.html 
    { 
     root /usr/share/nginx/html; 
     } 

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 
    # 
    #location ~ \.php$ { 
    # include snippets/fastcgi-php.conf; 
    # 
    # # With php7.0-cgi alone: 
    # fastcgi_pass 127.0.0.1:9000; 
    # # With php7.0-fpm: 
    # fastcgi_pass unix:/run/php/php7.0-fpm.sock; 
    #} 
    location ~ \.php$ 
    { 
     fastcgi_split_path_info ^(.+\.php)(/.+)$; 
     try_files $uri =404; 
     fastcgi_pass 127.0.0.1:9000; 
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
     fastcgi_index index.php; 
     include fastcgi_params; 
     } 

    # deny access to .htaccess files, if Apache's document root 
    # concurs with nginx's one 
    # 
    #location ~ /\.ht { 
    # deny all; 
    #} 
} 

это Displ ошибка ау enter image description here

пожалуйста, дайте мне решение, или попросить больше detile

+0

, пожалуйста, напишите файл default.conf и полный текст ошибки из журнала ошибок. – Satys

+0

default.conf и отображение ошибок добавлено, когда npm run build no error – erkajp

+0

- это ваше имя проекта статическое или что-то еще? конфигурация nginx для локальных дает мне goosebump. – Satys

ответ

0

Try обновить nginx.conf:

SendFile выключения;