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

这里,因为服务器部署了很多的应用程序,可以建一个主目录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. X86服务器、小型机、大型机、塔式、机架式、刀片式服务器、工作站

    ü  服务器分:x86(PC)服务器,小型机(Unix服务器),大型机: pc服务器则主要指基于intel处理器的x86架构,是一个通用开放的系统. UNIX服务器,也就是中国业内习惯上说的小型机,在 ...

  2. 使用scrapy进行12306车票查询

    概述 通过12306的查询API进行查询某日火车票, 结果保存在csv文件中. 详细 代码下载:http://www.demodashi.com/demo/12623.html 一.环境搭建 1. 安 ...

  3. log4j 配置(转)

    log4j是干什么的 log4j是Apache的一个开源项目,主要功能是打印日志信息,以各种形式在各种地方花式打印日志. 使用log4j的准备工作 使用log4j就必须要引入其jar包.附上官网地址h ...

  4. ubuntu下运行第一个.net core web程序

    前置条件 ubuntu系统 且已经安装dotnetcore运行环境 mkdir  testMVC 创建一个文件夹 cd testMVC    进入文件夹 dotnet new -t web 创建程序( ...

  5. C#指南,重温基础,展望远方!(2)程序结构

    C# 中的关键组织结构概念包括程序.命名空间.类型.成员和程序集. C# 程序由一个或多个源文件组成. 程序声明类型,而类型则包含成员,并被整理到命名空间中. 类型示例包括类和接口. 成员示例包括字段 ...

  6. 一个官翻教程集合:ASP.NET Core 和 EF Core 系列教程

    通过一个大学课程案例讲解了复杂实体的创建过程及讲解 1.ASP.NET Core 和 Entity Framework Core 系列教程——入门 (1 / 10) 2.ASP.NET Core 和 ...

  7. MQTT Client软件-MQTTBox

    最近发现了一个连接mqtt broker的软件:MQTTBox.GitHub地址:https://github.com/workswithweb/MQTTBox 官网网站的介绍为:使用MQTTBox增 ...

  8. App登录注册功能,怎样做到用户体验最佳?

    用户登录系统,可以细分为三项功能模块,分别是:登录.注册和密码找回.本文作者将结合自身经历,谈谈他在做这块的时候一些想法,主要是涉及业务流程. 登录和注册功能,不论是PC端还是移动端,大多数产品都会涉 ...

  9. Lintcode---二叉树的层次遍历(原型)

    给出一棵二叉树,返回其节点值的层次遍历(逐层从左往右访问) 您在真实的面试中是否遇到过这个题? Yes 样例 给一棵二叉树 {3,9,20,#,#,15,7} : 3 / \ 9 20 / \ 15 ...

  10. Python处理验证码第一篇(pytesser初探及报错处理)

    (原文链接:http://blog.csdn.net/Bone_ACE/article/details/50436587) 前言: 春节期间,无法全身心投入地去写爬虫,那就玩玩验证码吧,应该比较有趣! ...