关于 Linux windows 平台上的Nginx 403错误
来源:互联网 发布:喋血街头java 编辑:程序博客网 时间:2024/05/24 06:29
我们在启动Nginx的时候往往会遇到403错误,我这里没有存在index.html和index.htm文件所以
报错:
我的配置文件如下
1:conf/vhost/www.listore.com.conf
server {
listen 80;server_name www.listore.com;
location / {
root F:\SVN;
index index.html index.htm;
#autoindex on;
#autoindex_exact_size on;
#autoindex_localtime on;
}
}
出现错误的原因是没有找到index.html 和index.htm文件
加上如下配置
autoindex on;
autoindex_exact_size on;
autoindex_localtime on;
自动罗列所指定文件夹里面的子目录或者子文件这样就不会报403错误了
主配置文件:
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
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;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#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;
}
# 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$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
include vhost/*.conf;
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
- 关于 Linux windows 平台上的Nginx 403错误
- Nginx+PHP在Windows平台上的搭建
- 关于Linux C++代码在Windows平台上的调试运行
- 关于分在 Linux windows 平台下对github上的文件进行克隆 上传
- Nginx 在 Windows 平台上编译
- nginx在linux和windows系统上的编译安装
- windows平台是上的sublime编辑远程linux平台上的文件
- Wine v0.9.51 - Linux上运行Windows程序的平台
- snprintf 在 linux 和 windows 平台上的差别
- 不同平台windows、linux、mac 上换行符的问题
- 不同平台windows、linux、mac 上换行符的问题
- windows平台上的PHP运行在IIS,Apache,Nginx的性能和速度测试日志
- Linux平台上关于工具Wine的完全使用指南(1)
- Linux平台上关于工具Wine的完全使用指南(2)
- Linux平台上关于工具Wine的完全使用指南(1)
- Linux平台上关于工具Wine的完全使用指南
- 关于windows平台上的java和c/c++的editplus搭建开发平台
- 关于Windows、linux跨平台的一些建议
- 分布式架构学习之:028--ActiveMQ高可用集群(zookeeper+leveldb)安装、配置、高可用测试
- Android 弱引用
- union 与 union all 的区别
- linux系统下安装tomcat
- git创建分支、切换分支
- 关于 Linux windows 平台上的Nginx 403错误
- 讨论事务的隔离性下,商品库存超买问题
- excel根据一列的值匹配另一列
- oracle数据库常用函数
- excel 导入插入数据库
- gpg加密文件
- ViewPager PageTransformer探索
- Ubuntu下安装MySQL
- oracle一个创建用户、创建表空间、授权、建表的完整过程