NGINX + PageSpeed + PHP-FPM = JavaScript Uncaught SyntaxError: Unexpected number

#
NGINX + PageSpeed + PHP-FPM = JavaScript Uncaught SyntaxError: Unexpected number
Доброго вечера.
Развернул сервер на nginx + pagespeed + php7.1-fpm
cgi.fix_pathinfo = 0

конфиг nginx.conf
user www-data;
pid /var/run/nginx.pid;
worker_rlimit_nofile 200000;
worker_processes 8;

events {
        use epoll;
        accept_mutex off;
        worker_connections 4096;
        multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        sendfile_max_chunk 512k;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 90;
        keepalive_requests 1000;
        types_hash_max_size 2048;
        server_tokens off;

        reset_timedout_connection on;
        client_body_timeout 90;
        client_max_body_size 1024m;
        send_timeout 20;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        open_file_cache max=200000 inactive=20s;
        open_file_cache_valid 30s;
        open_file_cache_min_uses 2;
        open_file_cache_errors on;

        ##
        # SSL Settings
        ##

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

        log_format main ‘$remote_addr – $remote_user [$time_local] $status ‘
        ‘»$request» $body_bytes_sent «$http_referer» ‘
        ‘»$http_user_agent» «http_x_forwarded_for»‘;
        access_log /var/log/nginx/access.log main;

        ##
        # Gzip Settings
        ##
        gzip off;

        ##
        # Virtual Host Configs
        ##
        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        include /etc/nginx/fastcgi.conf;
        include /etc/nginx/conf.d/*;
}


конфиг сайта
server {
        listen *:80;
        server_name     hydro-land.ru www.hydro-land.ru;

        index           index.htm index.html index.php;
        root            /var/www/hydro-land.ru;

        access_log      /var/log/nginx/hydro-land.ru.access.log main;
        error_log       /var/log/nginx/hydro-land.ru.error.log;

        pagespeed on;
        pagespeed FileCachePath "/var/cache/ngx_pagespeed/";
        pagespeed RewriteLevel OptimizeForBandwidth;
        location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
                add_header "" "";
        }
        location ~ "^/pagespeed_static/" { }
        location ~ "^/ngx_pagespeed_beacon$" { }
        location / {
                try_files       $uri $uri/ /index.php$is_args$args;
        }
        location ~ \.php$ {
                try_files       $uri =404;
                fastcgi_read_timeout 900;
                fastcgi_pass    unix:/var/run/php/php7.1-fpm.sock;
                fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param   PATH_INFO $fastcgi_script_name;
                include         fastcgi_params;
        }
        location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js)$ {
                root /var/www/hydro-land.ru;
                index index.php;
        }
        location = /favicon.ico {
                log_not_found off;
                access_log off;
        }
        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
        }
        location ~* /\.(ht|git|svn) {
                deny  all;
        }
}


Сайт запускается, по страницам ходит нормально, обмен с 1С выполняется корректно, но все JS файлы не работают, они подключаются, в структуре дебагера видны.
Вот что пишет в консоли:

Uncaught SyntaxError: Unexpected number
jquery-3.3.1.min.js:2

Uncaught TypeError: Cannot read property 'fn' of undefined
bootstrap.bundle.js:1
    at setTransitionEndSupport (bootstrap.bundle.js:1)
    at bootstrap.bundle.js:1
    at bootstrap.bundle.js:1
    at bootstrap.bundle.js:1
    at bootstrap.bundle.js:1

Uncaught ReferenceError: jQuery is not defined
jquery.range-min.js:1
    at jquery.range-min.js:1
jquery.validate.min.js:16

Uncaught SyntaxError: Invalid or unexpected token
jquery.lightbox.js:1

Uncaught ReferenceError: jQuery is not defined
    at jquery.lightbox.js:1
jquery.bbedit.js:1

Uncaught ReferenceError: jQuery is not defined
    at jquery.bbedit.js:1
jquery.autocomplete.min.js:1

Uncaught ReferenceError: jQuery is not defined
    at jquery.autocomplete.min.js:1
    at jquery.autocomplete.min.js:1
hostcms.js:1

Uncaught ReferenceError: jQuery is not defined
    at hostcms.js:1
main.js:1

Uncaught ReferenceError: jQuery is not defined
    at main.js:1
slick.min.js:1

Uncaught ReferenceError: jQuery is not defined
    at slick.min.js:1
    at slick.min.js:1
script.js:1

Uncaught ReferenceError: $ is not defined
    at script.js:1
(index):674

Uncaught ReferenceError: $ is not defined
    at (index):674
jquery.min.js:3

Uncaught SyntaxError: Invalid or unexpected token
jquery-ui.min.js:7

Uncaught SyntaxError: Invalid or unexpected token
jquery.tinymce.min.js:1

Uncaught ReferenceError: jQuery is not defined
    at jquery.tinymce.min.js:1
jquery.minicolors.min.js:1

Uncaught ReferenceError: jQuery is not defined
    at jquery.minicolors.min.js:1
    at jquery.minicolors.min.js:1
jquery.slimscroll.min.js:1

Uncaught ReferenceError: jQuery is not defined
    at jquery.slimscroll.min.js:1
(index):725

Uncaught ReferenceError: $ is not defined
    at (index):725
frontend.js:1

Uncaught TypeError: Cannot read property 'fn' of undefined
    at frontend.js:1
(index):747

Uncaught TypeError: $ is not a function
    at (index):747
    at (index):747


И так везде, админка вообще кривая и не работает.

Обыскал гугл в поисках причин, так понять и не смог.
Модератор
#
Re: NGINX + PageSpeed + PHP-FPM = JavaScript Uncaught SyntaxError: Unexpected number
Логично предположить, что проблемы создает вам pagespeed
файл 2.0.3 оригинальный размер 83490, у вас сервер отдает 83487, потеряны 3 байта (переводы строк). Причины поищите в гугле.
#
Re: NGINX + PageSpeed + PHP-FPM = JavaScript Uncaught SyntaxError: Unexpected number
Отключил PageSpeed (pagespeed off ситуация не изменилась, JS все равно не работает.
Модератор
#
Re: NGINX + PageSpeed + PHP-FPM = JavaScript Uncaught SyntaxError: Unexpected number
kashin,
вероятно он не отключился, сравнивайте размеры файлов и ищите причины, удаленно ваш сервер не удастся конфигурировать.
#
Re: NGINX + PageSpeed + PHP-FPM = JavaScript Uncaught SyntaxError: Unexpected number
Снес nginx с pagespeed, установил обычный через apt-get install nginx, ребутнул сервак, ситуация не изменилась.
Модератор
#
Re: NGINX + PageSpeed + PHP-FPM = JavaScript Uncaught SyntaxError: Unexpected number
kashin,
так может вы уже порченые файлы на сервер записали? Сравните наконец!
Авторизация