nginx搭建文件服务器
在部署了各种应用后,产生的日志文件,需要在线下载查看,不用每次登陆服务器去拿;
这里,因为服务器部署了很多的应用程序,可以建一个主目录mylog,在主目录里用软连接将需要的各个日志文件夹都建好连接 ln -s 源文件夹/ 目标文件夹 后面不需要 /
在将主目录mylog配到nginx.conf ,这里有个主意的地方,就是nginx.conf里 user 要配置,否则报403禁止访问;
nginx.conf 配置如下:
user weblogic;
#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;
sendfile_max_chunk 256K;
tcp_nodelay on;
tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
"/etc/nginx/nginx.conf" 132L, 3126C
user weblogic;
#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;
sendfile_max_chunk 256K;
tcp_nodelay on;
tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
# client_max_body_size 8G;
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
location ^~ /cbblogs {
# alias /home/weblogic/apps/mylog;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/pass_file;
alias /home/nginx/mylog/;
charset utf-8;
autoindex on;
# autoindex_exact_size off; //
autoindex_localtime on;
autoindex_exact_size off;
}
#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;
...............
最新文章
- QueryRunner类 的應用,以及ResultSetHandler 接口的实现类
- Java算法之字符串反转分析
- RAC转换为RAC One Node
- spotify engineering culture part 1
- Mybatis 和 Spring配置
- Oracle数据库ORA-12154: TNS: 无法解析指定的连接标识符详解
- iOS UIView指定显示摸一个角弧形显示
- Git 介绍
- MVC零基础学习整理(一)
- iOS百度推送的基本使用
- Gunicorn与uWSGI
- Confluence 6 用户宏示例 - Formatted Panel
- shell编程之测试和判断
- 最完整Android Studio插件整理 (转)
- 支持向量机SVM进阶
- ssm项目快速搭建(配置)
- linux: convmv =-======pkgs.org
- jenkins-cli命令使用总结
- Eclipse常用快捷键(转载)
- CentOS 中查看软件的版本号