浏览器报错:Uncaught SyntaxError: Invalid or unexpected token (at webgl.framework.js.gz:1:1)
我的nginx配置:
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
gzip_static on;
gzip_proxied expired no-cache no-store private auth;
keepalive_timeout 65;
client_max_body_size 100m;
types {
application/javascript js;
application/javascript js.gz;
text/css css;
text/css css.gz;
application/json json;
application/json json.gz;
text/html html;
text/html html.gz;
application/xml xml;
application/xml xml.gz;
}
server {
listen 80;
server_name 我的域名不便透露.com;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html/app;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /api/ {
proxy_pass http://xxxx:9202/;
}
location /ws/ {
proxy_pass http://xxxx:9202/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
#location ~* \.(js|css|html|xml|json)$ {
# add_header Content-Encoding gzip;
# try_files $uri.gz $uri =404;
#}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}
我的nginx配置:
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
gzip_static on;
gzip_proxied expired no-cache no-store private auth;
keepalive_timeout 65;
client_max_body_size 100m;
types {
application/javascript js;
application/javascript js.gz;
text/css css;
text/css css.gz;
application/json json;
application/json json.gz;
text/html html;
text/html html.gz;
application/xml xml;
application/xml xml.gz;
}
server {
listen 80;
server_name 我的域名不便透露.com;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html/app;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /api/ {
proxy_pass http://xxxx:9202/;
}
location /ws/ {
proxy_pass http://xxxx:9202/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
#location ~* \.(js|css|html|xml|json)$ {
# add_header Content-Encoding gzip;
# try_files $uri.gz $uri =404;
#}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}