在部署了各种应用后,产生的日志文件,需要在线下载查看,不用每次登陆服务器去拿;

这里,因为服务器部署了很多的应用程序,可以建一个主目录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;

...............

最新文章

  1. QueryRunner类 的應用,以及ResultSetHandler 接口的实现类
  2. Java算法之字符串反转分析
  3. RAC转换为RAC One Node
  4. spotify engineering culture part 1
  5. Mybatis 和 Spring配置
  6. Oracle数据库ORA-12154: TNS: 无法解析指定的连接标识符详解
  7. iOS UIView指定显示摸一个角弧形显示
  8. Git 介绍
  9. MVC零基础学习整理(一)
  10. iOS百度推送的基本使用
  11. Gunicorn与uWSGI
  12. Confluence 6 用户宏示例 - Formatted Panel
  13. shell编程之测试和判断
  14. 最完整Android Studio插件整理 (转)
  15. 支持向量机SVM进阶
  16. ssm项目快速搭建(配置)
  17. linux: convmv =-======pkgs.org
  18. jenkins-cli命令使用总结
  19. Eclipse常用快捷键(转载)
  20. CentOS 中查看软件的版本号

热门文章

  1. easyui datebox 扩展清空按钮
  2. jquery中ajax的相关事件汇总
  3. iOS 9应用开发教程之ios9中实现button的响应
  4. AHM ---301重定向
  5. II7.5配置IIS支持2G文件下载
  6. macbook的终端中使用gnu的ls命令
  7. makefile之findstring函数
  8. 谈一谈APP支付失败的处理
  9. ITDB系统搭建及实时备份
  10. PHP学习笔记(15)PDO数据库操作+AJAX无刷新技术删除用户