Возникла ошибка при работе с сайтами. Тест конфигурации web-сервера при сохранении файла '/etc/nginx/vhosts/degaoptical/degaoptical.kz.conf' завершился неудачно: nginx: [emerg] unknown directive "application/javascript" in /etc/nginx/vhosts/degaoptical/degaoptical.kz.conf:29 nginx: configuration file /etc/nginx/nginx.conf test failed
server {
server_name degaoptical.kz www.degaoptical.kz;
charset off;
index index.html index.php;
disable_symlinks if_not_owner from=$root_path;
include /etc/nginx/vhosts-includes/*.conf;
include /etc/nginx/vhosts-resources/degaoptical.kz/*.conf;
error_log /dev/null crit;
set $root_path /var/www/degaoptical/data/www/degaoptical.kz;
root $root_path;
error_page 598 = @backend;
# Сжатие
gzip on;
gzip_disable "msie6";
gzip_comp_level 9;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gzip_types text/plain application/xml
application/javascript
text/css
text/js
text/xml
image/svg+xml
image/x-icon
application/x-javascript
text/javascript
application/json
application/xml+rss;
# Прочие настройки
expires 30d;
client_max_body_size 100m;
client_body_buffer_size 128k;
client_header_timeout 5m;
client_body_timeout 20m;
send_timeout 20m;
client_header_buffer_size 1k;
large_client_header_buffers 4 16k;
location @backend {
proxy_read_timeout 1200;
proxy_connect_timeout 1200;
proxy_send_timeout 1200;
send_timeout 1200;
fastcgi_read_timeout 1200;
try_files $uri $uri/ /$2$3 /$3 /index.php = 404;
fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@degaoptical.kz";
fastcgi_pass unix:/var/www/php-fpm/1.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
location @fallback {
rewrite ^(.*)$ /index.php?$args last;
}
location @statics {
rewrite ^/(\w+)/(.*)$ /$2 break;
access_log off;
rewrite_log off;
expires max;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
}
location / {
#index index.php index.html index.htm;
rewrite ^/api/(.*)$ /api.php?_d=$1&ajax_custom=1&$args last;
try_files $uri $uri/ @fallback;
rewrite /ru(.*) /$1 permanent;
rewrite ^(.*[^/])$ $1/ permanent;
location ~* \.(jpeg|ico|jpg|gif|png|css|js|pdf|txt|tar|wof|csv|zip|svg) {
access_log off;
try_files $uri @statics;
expires max;
add_header Access-Control-Allow-Origin *;
add_header Cache-Control public;
}
location ~* \.([pP][hH][pP].?)$ {
return 598;
}
location ^~ /app/payments/ {
return 404;
location ~ \.php$ {
return 598;
}
}
location ^~ /app/addons/paypal/payments/ {
return 404;
location ~ \.php$ {
return 598;
}
}
location ^~ /design/ {
allow all;
location ~* \.([tT][pP][lL]|[pP][hH][pP].?)$ {
return 404;
}
}
location ^~ /var/ {
return 404;
location ~* \.(js|css|png|jpeg|jpg|gz|xml|yml)$ {
allow all;
expires 1M;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
}
}
location ^~ /var/themes_repository/ {
allow all;
location ~* \.([tT][pP][lL]|[pP][hH][pP].?)$ {
return 404;
}
}
location ^~ /images/ {
allow all;
location ~* \.([pP][hH][pP].?)$ {
return 404;
}
}
location = /init.php {
return 404;
}
location ~* \.([tT][pP][lL].?)$ {
return 404;
}
location ~ /\.(ht|git) {
return 404;
}
}
listen 185.146.3.219:80;
listen [2a00:5da0:1000:1::5c0]:80;
}
server {
server_name degaoptical.kz www.degaoptical.kz;
ssl_certificate "/var/www/httpd-cert/degaoptical/degaoptical.kz_le1.crtca";
ssl_certificate_key "/var/www/httpd-cert/degaoptical/degaoptical.kz_le1.key";
ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
add_header Strict-Transport-Security "max-age=31536000;";
ssl_dhparam /etc/ssl/certs/dhparam4096.pem;
charset off;
index index.html index.php;
disable_symlinks if_not_owner from=$root_path;
include /etc/nginx/vhosts-includes/*.conf;
include /etc/nginx/vhosts-resources/degaoptical.kz/*.conf;
error_log /dev/null crit;
set $root_path /var/www/degaoptical/data/www/degaoptical.kz;
root $root_path;
error_page 598 = @backend;
# Сжатие
gzip on;
gzip_disable "msie6";
gzip_comp_level 8;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gzip_types text/plain application/xml
application/javascript
text/css
text/js
text/xml
image/svg+xml
image/x-icon
application/x-javascript
text/javascript
application/json
application/xml+rss;
# Прочие настройки
expires 30d;
client_max_body_size 100m;
client_body_buffer_size 128k;
client_header_timeout 5m;
client_body_timeout 20m;
send_timeout 20m;
client_header_buffer_size 1k;
large_client_header_buffers 4 16k;
location @backend {
proxy_read_timeout 1200;
proxy_connect_timeout 1200;
proxy_send_timeout 1200;
send_timeout 1200;
fastcgi_read_timeout 1200;
try_files $uri $uri/ /$2$3 /$3 /index.php = 404;
fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@degaoptical.kz";
fastcgi_pass unix:/var/www/php-fpm/1.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
location @fallback {
rewrite ^(.*)$ /index.php?$args last;
}
location @statics {
rewrite ^/(\w+)/(.*)$ /$2 break;
access_log off;
rewrite_log off;
expires max;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
}
location / {
#index index.php index.html index.htm;
rewrite ^/api/(.*)$ /api.php?_d=$1&ajax_custom=1&$args last;
try_files $uri $uri/ @fallback;
rewrite /ru/(.*) /$1 permanent;
rewrite ^(.*[^/])$ $1/ permanent;
location ~* \.(jpeg|ico|jpg|gif|png|css|js|pdf|txt|tar|wof|csv|zip|svg) {
access_log off;
try_files $uri @statics;
expires max;
add_header Access-Control-Allow-Origin *;
add_header Cache-Control public;
}
location ~* \.([pP][hH][pP].?)$ {
return 598;
}
location ^~ /app/payments/ {
return 404;
location ~ \.php$ {
return 598;
}
}
location ^~ /app/addons/paypal/payments/ {
return 404;
location ~ \.php$ {
return 598;
}
}
location ^~ /design/ {
allow all;
location ~* \.([tT][pP][lL]|[pP][hH][pP].?)$ {
return 404;
}
}
location ^~ /var/ {
return 404;
location ~* \.(js|css|png|jpeg|jpg|gz|xml|yml)$ {
allow all;
expires 1M;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
}
}
location ^~ /var/themes_repository/ {
allow all;
location ~* \.([tT][pP][lL]|[pP][hH][pP].?)$ {
return 404;
}
}
location ^~ /images/ {
allow all;
location ~* \.([pP][hH][pP].?)$ {
return 404;
}
}
location = /init.php {
return 404;
}
location ~* \.([tT][pP][lL].?)$ {
return 404;
}
location ~ /\.(ht|git) {
return 404;
}
}
listen 185.146.3.219:443 ssl http2;
listen [2a00:5da0:1000:1::5c0]:443 ssl http2;
}
gzip_types text/plain application/xml
application/javascript
text/css
text/js
text/xml
image/svg+xml
image/x-icon
application/x-javascript
text/javascript
application/json
application/xml+rss;
gzip_types text/plain application/xml; application/javascript; text/css; text/js; text/xml; image/svg+xml; image/x-icon; application/x-javascript; text/javascript; application/json; application/xml+rss;
[root@srv ~]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@srv ~]#