nginx 配置动静态资源 为什么只加载静态资源路径,服务的静态资源不加载。如果两个都加载该怎么配置

upstream getway_pool_hh{
server 127.0.0.1:8068;
}

server {
listen 80;
server_name 112.124.202.74;
access_log logs/1.log;
error_log logs/12.error;

location / {
        index index.html;
    }
    location ~ .*\.(jpg|gif|png|css|js|html|txt)$ {
        add_header Access-Control-Allow-Origin *;
        add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept";
        add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
        gzip on;
        gzip_http_version 1.1;
        gzip_comp_level 2;
        gzip_types text/plain application/javascript application/x-javascript text/css text/javascript image/jpeg image/gif image/png;
        root /usr/local/sss/resource;
    }

    location ~ .*\.(eot|svg|ttf|woff|otf)$ {
        add_header Access-Control-Allow-Origin *;
        add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept";
        add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
        gzip on;
        gzip_http_version 1.1;
        gzip_comp_level 2;
        gzip_types application/vnd.ms-fontobject font/ttf font/opentype font/x-woff image/svg+xml;
        root /usr/local/sss/resource;
    }

    error_page 404 /404.html;
    # redirect server error pages to the static page /50x.html

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
           root html;
    }

location /getway {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://getway_pool_hh;
}

}

a821449400
a821449400 求大神指点!!!!
11 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问