nginx访问静态资源文件,未指定静态资源的名称怎么办
展开全部
今天在搭建nginx环境时出现一个奇怪问题,配置的静态资源目录下面文件无法访问,浏览器访问出现403 forbidden,环境是centos7 + nginx 1.6。nginx.conf中http配置如下:
[plain] view plain copy
……
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
upstream tomcat_server {
server 10.10.100.52:8080;
}
server {
listen 80;
charset utf-8;
server_name localhost;
location /fcm/ {
index index.html index.htm;
proxy_pass http://tomcat_server;
proxy_set_header X-Real-IP $remote_addr;
client_max_body_size 100m;
}
location /static/ {
root /home/www/static;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
[plain] view plain copy
……
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
upstream tomcat_server {
server 10.10.100.52:8080;
}
server {
listen 80;
charset utf-8;
server_name localhost;
location /fcm/ {
index index.html index.htm;
proxy_pass http://tomcat_server;
proxy_set_header X-Real-IP $remote_addr;
client_max_body_size 100m;
}
location /static/ {
root /home/www/static;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
Storm代理
2023-08-29 广告
2023-08-29 广告
"StormProxies是全球大数据IP资源服务商,其住宅代理网络由真实的家庭住宅IP组成,可为企业或个人提供满足各种场景的代理产品。点击免费测试(注册即送1G流量)StormProxies有哪些优势?1、IP+端口提取形式,不限带宽,I...
点击进入详情页
本回答由Storm代理提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询