#user  nobody;
worker_processes 4; #error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info; #pid logs/nginx.pid; events {
accept_mutex off;
} http {
include mime.types;
default_type application/octet-stream;
charset utf-8; #access_log logs/access.log main;
sendfile on;
sendfile_max_chunk 512k;
#tcp_nopush on; #keepalive_timeout 0;
keepalive_timeout 65; gzip on; client_max_body_size 10m; # another virtual host using mix of IP-, name-, and port-based configuration
# server {
listen 80;
server_name localhost;
     proxy_intercept_errors on; #配置error_page 错误页面开启
#文件服务器1
location "/C5F2B2C6-4262-EA28-F027-C335ECAEA9B3/Accessible File/" {
alias "D:/storeShare2/8C2FA5BC-7916-8310-EE65-C77C8A7916AE/Accessible File/";
} location "/BAEAA014-7D66-35CE-89B6-EAE8E3338BC7/" {
charset utf-8;
alias "D:/storeShare2/8C2FA5BC-7916-8310-EE65-C77C8A7916AE/"; #文件的根目录(允许使用本地磁盘,NFS,NAS,NBD等)
} #文件服务器2
location "/19E1CDA4-D4F9-A4D4-5FB5-CD0D338DDF75/Accessible File/" {
alias "D:/storeShare/34ABAD14-C547-DA72-1D61-97ABF395BCD0/Accessible File/";
} location "/783C4C77-D3EF-C2A7-174B-974BF69C1987/" {
charset utf-8;
alias "D:/storeShare/34ABAD14-C547-DA72-1D61-97ABF395BCD0/"; #文件的根目录(允许使用本地磁盘,NFS,NAS,NBD等)
} #负载均衡服务器上的文件预览与文件下载
location ~^/preview/http:/(.*)$ {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://$1; }
location ~^/downloadfile/http://(.*)$ {
charset utf-8;
internal;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://$1; } #负载均衡服务器上的web服务器跳转
location / {
charset utf-8;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8080/PodCloud/; #首先pass到应用服务器
} location /PodCloud/ {
charset utf-8;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8080/PodCloud/; #首先pass到应用服务器
}
    

      error_page 400 401 402 403 404 405 408 410 412 413 414 415 500 501 502 503 504 506 /404.html;
      location = /404.html {
        #放错误页面的目录路径。
        #proxy_pass http://127.0.0.1:80/404.html;
        root D:/nginx-1.9.12/html;
      }

    }
}

nginx.conf配置demo的更多相关文章

  1. linux下Nginx配置文件(nginx.conf)配置设置详解(windows用phpstudy集成)

    linux备份nginx.conf文件举例: cp /usr/local/nginx/nginx.conf /usr/local/nginx/nginx.conf-20171111(日期) 在进程列表 ...

  2. nginx简单的nginx.conf配置

    nginx.conf配置如下: #user nobody;worker_processes 1; #error_log logs/error.log;#error_log logs/error.log ...

  3. nginx的开机自启、server命令启动、nginx.conf配置

    1.将Nginx设置为开机自动启动 a.当上面6步完成之后,说明安装已经完全成功了,但是每次开机我们面临的一个问题,就是每次都要执行命令(1: cd /usr/local/nginx/sbin/   ...

  4. linux系统下nginx安装目录和nginx.conf配置文件目录

    linux系统下nginx安装目录和nginx.conf配置文件目录 1.查看nginx安装目录 输入命令 # ps  -ef | grep nginx 返回结果包含安装目录 root      26 ...

  5. nginx.conf 配置解析之文件结构

    nginx.conf配置文件结构如下: ...... #主要定义nginx的全局配置 events{ #events(事件)块:主要配置网络连接相关 } http{ #http块:代理缓存和日志定义绝 ...

  6. ubuntu 13.04 nginx.conf 配置详解

    1.nginx.conf 文件,路径为:/etc/nginx/agin.conf #使用的用户和组 user www-data; #指定工作衍生进程数(一般等于CPU总核数或总核数的两倍) worke ...

  7. nginx.conf配置及优化相关

    nginx.conf配置文件内容 user www www; worker_processes ; worker_rlimit_nofile ; error_log /data/nginx/logs/ ...

  8. nginx.conf配置

    在此记录下Nginx服务器nginx.conf的配置文件说明, 部分注释收集与网络. #运行用户 user www-data; #启动进程,通常设置成和cpu的数量相等 worker_processe ...

  9. Nginx 之二: nginx.conf 配置及基本优化

    一:常用功能优化: 1:网络连接的优化: 只能在events模块设置,用于防止在同一一个时刻只有一个请求的情况下,出现多个睡眠进程会被唤醒但只能有一个进程可获得请求的尴尬,如果不优化,在多进程的ngi ...

随机推荐

  1. IntelliJ IDEA 2019从入门到癫狂 图文教程!

    阅读本文大概需要 6 分钟. 作者:yizhiwazi 来源:www.jianshu.com/p/9c65b7613c30 前言:IntelliJ IDEA 如果说IntelliJ IDEA是一款现代 ...

  2. java读取文件夹下文件及txt内容

    public class PositionController {     // 读取txt内容     public static String txt2String(File file) {    ...

  3. python 获取天气信息,并绘制曲线

    import urllib.request import gzip import json print('------天气查询------') def get_weather_data() : cit ...

  4. Python3+mitmproxy安装使用教程(Windows)(转载)

    mitmproxy 是用于MITM的proxy,MITM中间人攻击.说白了就是服务器和客户机中间通讯多增加了一层.跟Fiddler和Charles最大的不同就是,mitmproxy可以进行二次开发,尤 ...

  5. 基于vue和echarts的数据可视化实现

    基于vue和echarts的数据可视化: https://github.com/MengFangui/awesome-vue.git

  6. js判断字符串是否以指定字符串开头或是否包含指定字符串

    1.  用js判断一个字符串是否是以某个子字符串开头如:ssss001是否以ssss开头, 可以这样做: 1 2 3 4 5 6 var fdStart = strCode.indexOf(" ...

  7. Filebeat的使用

    前言 logstash本身就可以具有文件数据采集的功能了,为什么还需要在前面加一层filebeat?理由如下:logstash是使用Java编写,插件是使用JRuby编写,对机器的资源要求会比较高,在 ...

  8. Spark闭包与序列化

    Spark的官方文档再三强调那些将要作用到RDD上的操作,不管它们是一个函数还是一段代码片段,它们都是“闭包”,Spark会把这个闭包分发到各个worker节点上去执行,这里涉及到了一个容易被忽视的问 ...

  9. webshot一款网页快照工具

    webshot https://github.com/brenden/node-webshot Webshot provides a simple API for taking webpage scr ...

  10. [转]python file文件操作--内置对象open

    python file文件操作--内置对象open   说明: 1. 函数功能打开一个文件,返回一个文件读写对象,然后可以对文件进行相应读写操作. 2. file参数表示的需要打开文件的相对路径(当前 ...