原始配置:
user nobody;
worker_processes 1;
#pid logs/nginx.pid;
worker_connections 1024;
}
http {
include 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 logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
upstream tomcat_server{
server localhost:81;
}
gzip on;
gzip_min_length 10k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 6;
gzip_vary on;
gzip_proxied any;
gzip_disable "MSIE [1-6].";
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass http://tomcat_server;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
问题描述:
除了chrome存在问题, 有ttf woff文件 无法获取,后台报如下错误:
解决方法:
将tomcat_server 改成 tomcatserver即可, 也是醉醉的。。。。
因为需要使用nginx gzip压缩功能,所 以使用了nginx,没想到有这个问题,还好经过群友的提示,顺利解决没耽误多长时间,留此一笔,希望能帮到大家!
欢迎各种讨论!