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

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

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

nginx搭建文件服务器的更多相关文章

  1. windows nginx 搭建文件服务器(通俗易懂)

    在一些项目里面,有时候需要访问图片的时候.相信很多人都是的直接把文件放到项目里面的: 今天在这里给大家介绍的是利用nginx 搭建图片服务器,直接访问磁盘上的图片. 方法一(使用root关键字): l ...

  2. 利用nginx搭建文件服务器

    1.安装nginx 安装教程:https://www.cnblogs.com/sunny1009/p/11411673.html 2.配置nginx 配置server节点下的location部分和se ...

  3. CentOS 6.3安装Nginx 搭建文件服务器

    转自:http://www.linuxidc.com/Linux/2012-09/70596.htm 1.配置CentOS 6.2 第三方yum源(CentOS默认的标准源里没有nginx软件包): ...

  4. nginx搭建文件服务器配置文件

    worker_processes 1; events { worker_connections 1024;} http { include mime.types; default_type appli ...

  5. 使用nginx搭建简单文件服务器

    最近再做一个博客,本想使用fastdfs标准的文件存储服务器,但考虑到资源占用问题,且使用nginx比较快速,且效果不差.于是采用ngixn搭建. nginx搭建文件服务器,本质上就是nginx的静态 ...

  6. CentOS 6(64-bit) + Nginx搭建静态文件服务器

    Nginx搭建静态文件服务器 使用命令打开Nginx配置文件: sudo vim /etc/nginx/conf.d/default.conf 将配置改为: server { ...... ..... ...

  7. Ubuntu 14.04TLS Nginx搭建静态文件服务器

    Nginx搭建静态文件服务器 [官方教程]https://www.nginx.com/resources/admin-guide/serving-static-content/ 打开Nginx的配置文 ...

  8. 利用 Nginx 搭建小型的文件服务器

    利用 Nginx 搭建小型的文件服务器 1.查看 Nginx 配置 android@localhost:/etc/nginx/conf.d$ nginx -hnginx version: nginx/ ...

  9. Nginx搭建简易文件服务器

    Nginx搭建简易文件服务器 1.安装nginx,此处略过 2.修改nginx配置文件 详细如下 # 此处为部分文件是否有权限,使用root,则不会出现403权限问题 user root; worke ...

随机推荐

  1. Unity 开发游戏编写代码的技巧

    在平时开发游戏过程中,遇到一些编写代码很繁琐的问题. 我发现我团队中每个人都会遇到,就算打写出来分享下经验. 条件断点 利用IDE提供的工具, 右键断点的时候 输入条件, 当条件达成的时候,断点才能命 ...

  2. [Java Performance] JVM 线程调优

    调整线程栈空间 当很缺少内存时,能够调整线程使用的内存. 每一个线程都有一个栈,用来记录该线程的调用栈信息.线程中的栈的默认空间是有OS和JVM的版本号决定的: OS 32-bit 64-bit Li ...

  3. docker中批量删除 tag为none的镜像

    添加定时任务,批量删除tag 为none 的镜像  ,释放磁盘空间 [root@weifeng]:~# crontab -l */ * * * /usr/bin/docker rmi `docker ...

  4. font-size<12 chrome不支持解决

    今天,群里有人问道font-size<12 chrome不支持的问题.说实话,这个我一直都没留意过,正好借个机会给自己补习一下. 自己亲自试过,确实如此,当font-size<12 chr ...

  5. 点滴积累【C#】---Highcharts图形统计

    效果: 思路: 后台获取数据!然后拼接为前台所要求的格式,再将拼接好的StringBuilder给了hidden控件! 然后前台获取JQuery获取Hidden的值,最后将值赋给图形! 代码: [前台 ...

  6. Atitit.request http乱码的设计防止 检测与解决最近实践p825 attilax总结.doc

    Atitit.request http乱码的设计防止 检测与解决最近实践p825 attilax总结.doc 1 浏览器判断一个页面的编码有俩个途径, 一种是通过HTTP响应头, 一个是通过meta: ...

  7. c语言循环单链表

    /************************************************************************* > File Name: singleLin ...

  8. tensorflow 之模型的保存与加载(一)

    怎样让通过训练的神经网络模型得以复用? 本文先介绍简单的模型保存与加载的方法,后续文章再慢慢深入解读. #!/usr/bin/env python3 #-*- coding:utf-8 -*- ### ...

  9. matplotlib之极坐标系的极径网格线(rgrids)的显示刻度

    matplotlib之极坐标系的极径网格线(rgrids)的显示刻度 #!/usr/bin/env python3 #-*- coding:utf-8 -*- #################### ...

  10. python学习之sys模块

    查看python的版本 >>> sys.version_info[] sys.argv 列表对象,传入模块参数的都会放入列表中. #-*- coding: utf-8 -*- # i ...