为什么nginx配置ssi配置启用了ssi但文件存在确报告404

网页打不开,显示404 Not Found ——nginx/1.0.6,求解决办法。_百度知道
网页打不开,显示404 Not Found ——nginx/1.0.6,求解决办法。
如题:网页打不开,显示404 Not Found ——nginx/1.0.6
复制那些解释原因就不用了,只求详细的解决办法,只好能简单快捷有效的。只有虎扑论坛是这样,暂时没有发现其他网页有问题,不知道是不是跟虎扑最近更换了域名有关系。只要能解决,分不会少。
我有更好的答案
404 Not Found 服务器找不到请求的网页。例如,如果请求是针对服务器上不存在的网页进行的,那么,服务器通常会返回此代码。这个与你nginx设置有关,通常是nginx设置的访问路径下没有相应的网页。!最好给出你nginx的配置文件。我给你一个示例,是我的nginx配置:...server {
server_name app.test.
index index.jsp index.htm index.
/home/app/login/jboss/webapps
.... location ~ .*\.(xml|htm|html)$
expires -1s;
}....}如上所配置,加入你直接访问app.test.cc 。那么请求会直接到你root设置的目录/home/app/login/jboss/webapps下依次找寻index index.jsp index.htm index.html的页面文件,没有找到就会报404错误。另,你可以安装firefox并安装组件firebug,打开firefox按F12,再访问你的页面。这时候,火狐会将你访问请求的每一步,失败的原因,及失败的链接都给出来。
采纳率:37%
显示404说明你的网页不存在。我说一下基本的解决思路:1. 找到nginx的配置文件,nginx.conf
查看server 配置段中的root指定目录,也就是说你网站的根目录3.
查看有没有你要访问的内容, index.php 或者 index.html 等
换个浏览器上看看,CHROME
你说的那个浏览器没试过。但是原来用的IE、傲游,换了非IE内核的火狐也不行。。
你可以试试看
为您推荐:
其他类似问题
您可能关注的内容
网页打不开的相关知识
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。18:04 提问
Linx nginx 文件服务器报404,求大神帮忙看下
本来想要实现这种效果
nginx.conf配置文件如下
[root@localhost conf]# vi nginx.conf
worker_processes
#error_log
logs/error.
#error_log
logs/error.
#error_log
logs/error.
logs/nginx.
worker_connections
include /etc/nginx/conf.d/*.
default_type
application/octet-
#log_format
'$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
#access_log
logs/access.
client_header_buffer_size 100M;
autoindex_exact_
autoindex_
#keepalive_timeout
keepalive_timeout
root /home/files/;
#charset koi8-r;
#access_log
logs/host.access.
location ~ .*.(htm|html|gif|jpg|jpeg|png|bmp|swf|ioc|rar|zip|txt|flv|mid|doc|ppt|pdf|xls|mp3|wma)$ { expires 15d; }
location ~ .*\.(gif|jpg|pocx|poc|xls|xlsx|mp4|jpeg|png)$ {
expires 24h;
root /home/files/;
access_log /home/nginx/logs/images.
proxy_store_access user:rw group:rw all:
proxy_temp_path
/home/files/;
proxy_set_header
Host 127.0.0.1;
proxy_set_header
X-Real-IP $remote_
proxy_set_header
X-Forwarded-For $proxy_add_x_forwarded_
client_max_body_size
client_body_buffer_size 1280k;
proxy_connect_timeout
proxy_send_timeout
proxy_read_timeout
proxy_buffer_size
proxy_buffers
proxy_busy_buffers_size 640k;
proxy_temp_file_write_size 640k;
if ( !-e $request_filename)
proxy_pass
http://127.0.0.1:8088;
location / {
index.html index.
#error_page
# redirect server error pages to the static page /50x.html
error_page
500 502 503 504
location = /50x.html {
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#location ~ \.php$ {
proxy_pass
http://127.0.0.1;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#location ~ \.php$ {
fastcgi_pass
127.0.0.1:9000;
fastcgi_index
fastcgi_param
SCRIPT_FILENAME
/scripts$fastcgi_script_
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#location ~ /\.ht {
# another virtual host using mix of IP-, name-, and port-based configuration
somename:8080;
server_name
location / {
index.html index.
# HTTPS server
ssl_certificate
ssl_certificate_key
ssl_session_cache
shared:SSL:1m;
ssl_session_timeout
ssl_ciphers
HIGH:!aNULL:!MD5;
ssl_prefer_server_
location / {
index.html index.
按赞数排序
哥们,你这个配置的有问题啊,这个是占用了8088端口
下面的配置,也就是
if ( !-e $request_filename)
也是8088端口,你是要弄甚
/home/files/html
这个目录存在吗,有什么文件,你root映射的路径正确吗
vim /usr/local/nginx/conf/nginx.conf
#nginx 系统用户和用户组(了解)
3 worker_#启动进程
5 error_log
/home/wwwlogs/nginx_error.#错误日志
/usr/local/nginx/logs/nginx.
8#主程序pid保存文件
9 #Specifies the value for maximum file descriptors that can be opened by this
10 worker_rlimit_nofile 51200;
11#文件描述符数量
14#linux建议使用epoll
worker_connections 51200;
#单个工作进程最大允许连接数
18#http 整个环境配置
default_type
application/octet-
#设定mime类型 文件传送类型有mimetype文件定义
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;
#serndfile on 是必须设置为on
keepalive_timeout 60;
#连接超时时间
#禁用naglo算法 也就是不缓存数据
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
gzip_min_length
gzip_buffers
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types
text/plain application/javascript application/x-javas
cript text/javascript text/css application/xml application/xml+
gzip_proxied
expired no-cache no-
gzip_disable
"MSIE [1-6].";
#limit_conn_zone $binary_remote_addr zone=perip:10m;
##If enable limit_conn_zone,add "limit_conn perip 10;" to server sec
#隐藏nginx 版本号
#log format
log_format
'$remote_addr - $remote_user [$time_local] "$req
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
# 定义日志格式
listen 80 default_#监听80端口
#listen [::]:80 default_server ipv6only=
server_name
index index.html index.htm index. #默认网站页面
/home/wwwroot/ #网页主目录
#error_page
include enable-php.
location /nginx_status
#开启status 状态监听
location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
静态文件处理保存时间 30天
location ~ .*.(js|css)?$
js和css文件处理保存时间12小时
location ~ /.
#正确访问日志
access_log
/home/wwwlogs/access.
}# vhost 下面是子配置文件生效
98 include vhost/*.
八、检查nginx 配置文件语法错误
/usr/local/ngind/sbin/nginx -t
九、nginx 虚拟主机(重点重点重点)
跳转到我们指定的页面上
1. 没有目录 创建目录
mkdir /home/wwwroot/sina/
mkdir /home/wwwroot/sohu/
2. 文件夹里面没有测试文件
vim /home/wwwroot/sina/index.html
vim /home/wwwroot/sohu/index.html
3. 调整我们的配置文件
vim /usr/local/nginx/conf/nginx.conf
#listen 80 default_
listen 80;
#listen [::]:80 default_server ipv6only=
server_name
index index.html index.htm index.
/home/wwwroot/
root /home/wwwroot/
#error_page
include enable-php.
location /nginx_status
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
location ~ .*\.(js|css)?$
location ~ /\.
#access_log
/home/wwwlogs/access.
access_log
/home/wwwlogs/access_sina.
include vhost/*.
检测配置文件是否修改成功
/usr/local/nginx/sbin/nginx -t
出现下面内容说明配置文件没有任何问题
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
lnmp restart
十、列表页显示(重点重点重点)
修改配置文件
vim /usr/local/nginx/conf/nginx.conf
#listen 80 default_
listen 80;
#listen [::]:80 default_server ipv6only=
server_name
index index.html index.htm index.
/home/wwwroot/
root /home/wwwroot/
#error_page
include enable-php.
location /nginx_status
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
location ~ .*\.(js|css)?$
[root@localhost sbin]# vim /usr/local/nginx/conf/nginx.conf
#error_log
logs/error.
#error_log
logs/error.
#error_log
logs/error.
error_log /usr/local/nginx/logs/error.
pid /usr/local/nginx/logs/nginx.
worker_rlimit_nofile 65535;
worker_connections
default_type
application/octet-
server_names_hash_bucket_size 128;
large_client_header_buffers 4 32k;
client_max_body_size 50m;
#access_log
logs/access.
client_header_buffer_size 100M;
autoindex_exact_
autoindex_
keepalive_timeout
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/
8080 default_
server_name
index index.html index.htm
root /home/files/;
#charset koi8-r;
#access_log
logs/host.access.
location ~ .*.(htm|html|gif|jpg|jpeg|png|bmp|swf|ioc|rar|zip|txt|flv|mid|doc|ppt|pdf|xls|mp3|wma)$ { expires 15d; }
location ~ .*\.(gif|jpg|pocx|poc|xls|xlsx|mp4|jpeg|png)$ {
expires 24h;
root /home/files/;
access_log /home/nginx/logs/images.
proxy_store_access user:rw group:rw all:
proxy_temp_path
/home/files/;
proxy_set_header
Host 127.0.0.1;
proxy_set_header
X-Real-IP $remote_
proxy_set_header
X-Forwarded-For $proxy_add_x_forwarded_
client_max_body_size
client_body_buffer_size 1280k;
proxy_connect_timeout
proxy_send_timeout
proxy_read_timeout
proxy_buffer_size
proxy_buffers
proxy_busy_buffers_size 640k;
proxy_temp_file_write_size 640k;
if ( !-e $request_filename)
proxy_pass
http://127.0.0.1:8088;
location / {
root /e:/HRoneFileS
proxy_pass http://127.0.0.1:88;
proxy_set_header X-Real-IP $remote_
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_
proxy_set_header Host $
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_intercept_
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
autoindex_
autoindex_exact_
charset utf-8,
error_page 500 502 503 504 /50x.
location = /50x.html {
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐NGINX技术总结报告_百度文库
您的浏览器Javascript被禁用,需开启后体验完整功能,
赠送免券下载特权
10W篇文档免费专享
部分付费文档8折起
每天抽奖多种福利
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
NGINX技术总结报告
阅读已结束,下载本文需要
想免费下载本文?
定制HR最喜欢的简历
下载文档到电脑,同时保存到云知识,更方便管理
加入VIP
还剩14页未读,
定制HR最喜欢的简历
你可能喜欢博客分类:
Server Side Include,通常称为服务器端嵌入,是一种类似于ASP的基于服务器的网页制作技术。大多数(尤其是基于Unix平台)的WEB服务器如Netscape Enterprise Server等均支持SSI命令。
为什么要用SSI
用个例子来说明,一个静态化的页面中,需要嵌入一小块实时变化的内容,。例如首页,大部分的页面内容需要缓存但是用户登录后的个人信息是动态信息,不能缓存。那么如何解决这个”页面部分缓存”问题,利用SSI就可以解决,在首页的静态页面中嵌入个人信息的动态页,由于是服务器端的嵌入,所以用户浏览的时候都是一个嵌入后的页面。
nginx配置SSI
主要是三个参数,ssi,ssi_silent_errors和ssi_types,均可以放在http,server和location的作用域下。
ssi on开启ssi支持,默认是off
ssi_silent_errors on默认值是off,开启后在处理SSI文件出错时不输出错误提示:”[an error occurred while processing the directive] ”
ssi_types默认是ssi_types text/html,所以如果需要htm和html支持,则不需要设置这句,如果需要shtml支持,则需要设置:ssi_types text/shtml
页面上配置
&!–# include file=”/m//index_top.html”–&
&!–# include virtual=”/m//index_top.html”–&
1.开启shtml后缀的文件名支持ssi
ssi_silent_
ssi_types text/
2.开启html后缀的文件名支持ssi
ssi_silent_
3.在zt目录下开启html后缀的文件名支持ssi
location /hx/{
ssi_silent_
浏览 16903
浏览: 143153 次
来自: 深圳
import com.iqbon.jcms.domain.Qu ...
根据以上操作连接成功,谢谢分享!
大牛 我弱弱的问一句QuartzService是如何被调用的
sdjnzqr 写道这几种貌似不适合企业级的架构选型
领导要求 ...
这几种貌似不适合企业级的架构选型
(window.slotbydup=window.slotbydup || []).push({
id: '4773203',
container: s,
size: '200,200',
display: 'inlay-fix'apache和nginx支持SSI配置 – 运维生存时间
你可能喜欢
有回复时邮件通知我
关于本站 本站以分享运维技术为主,欢迎大家参与技术分享,同时也欢迎大家吐槽,本站提供以下交流圈:QQ群①:*****(满)QQ群②:6690706 QQ群③: QQ群④:(新) 微信公众号:ttlsacom 商务合作QQ:
记住我的登录信息
点击“立即注册”转到用户注册页面。
输入用户名或电子邮箱地址,您会收到一封新密码链接的电子邮件。
用户名或电子邮件地址

我要回帖

更多关于 nginx ssi 模块 的文章

 

随机推荐