nginx.conf配置demo
#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的更多相关文章
- linux下Nginx配置文件(nginx.conf)配置设置详解(windows用phpstudy集成)
linux备份nginx.conf文件举例: cp /usr/local/nginx/nginx.conf /usr/local/nginx/nginx.conf-20171111(日期) 在进程列表 ...
- nginx简单的nginx.conf配置
nginx.conf配置如下: #user nobody;worker_processes 1; #error_log logs/error.log;#error_log logs/error.log ...
- nginx的开机自启、server命令启动、nginx.conf配置
1.将Nginx设置为开机自动启动 a.当上面6步完成之后,说明安装已经完全成功了,但是每次开机我们面临的一个问题,就是每次都要执行命令(1: cd /usr/local/nginx/sbin/ ...
- linux系统下nginx安装目录和nginx.conf配置文件目录
linux系统下nginx安装目录和nginx.conf配置文件目录 1.查看nginx安装目录 输入命令 # ps -ef | grep nginx 返回结果包含安装目录 root 26 ...
- nginx.conf 配置解析之文件结构
nginx.conf配置文件结构如下: ...... #主要定义nginx的全局配置 events{ #events(事件)块:主要配置网络连接相关 } http{ #http块:代理缓存和日志定义绝 ...
- ubuntu 13.04 nginx.conf 配置详解
1.nginx.conf 文件,路径为:/etc/nginx/agin.conf #使用的用户和组 user www-data; #指定工作衍生进程数(一般等于CPU总核数或总核数的两倍) worke ...
- nginx.conf配置及优化相关
nginx.conf配置文件内容 user www www; worker_processes ; worker_rlimit_nofile ; error_log /data/nginx/logs/ ...
- nginx.conf配置
在此记录下Nginx服务器nginx.conf的配置文件说明, 部分注释收集与网络. #运行用户 user www-data; #启动进程,通常设置成和cpu的数量相等 worker_processe ...
- Nginx 之二: nginx.conf 配置及基本优化
一:常用功能优化: 1:网络连接的优化: 只能在events模块设置,用于防止在同一一个时刻只有一个请求的情况下,出现多个睡眠进程会被唤醒但只能有一个进程可获得请求的尴尬,如果不优化,在多进程的ngi ...
随机推荐
- Flink入门介绍
什么是Flink Apache Flink是一个分布式大数据处理引擎,可以对有限数据流和无限数据流进行有状态计算.可部署在各种集群环境,对各种大小的数据规模进行快速计算. Flink特性 支持高吞吐. ...
- leetcode 494. 目标数
题目描述: 给定一个非负整数数组,a1, a2, ..., an, 和一个目标数,S.现在你有两个符号 + 和 -.对于数组中的任意一个整数,你都可以从 + 或 -中选择一个符号添加在前面. 返回可以 ...
- SpringCloud之application.properties和bootstrap.properties区别
Spring是有上下文一说的,也叫Application Context,Application Context又是有父子关系的,所以必须要理解ApplicationContext是什么.Spring ...
- Linux虚拟机:发布WebService接口出现异常,无法访问接口
Linux虚拟机:发布WebService接口出现异常,无法访问接口 今天在部署WebService工程的时候遇到的问题: 在Linux虚拟机上部署一个tomcat同时在tomcat下放置2个工程,其 ...
- g-api notes
目录 Q: What is GOrigin? What the meaning of parameters GMat(const GNode &n, std::size_t out) Q: h ...
- WD MyBook Live Duo 重装教程
9102年了,我还在用MBL DUO 前情提要:这个设备基础配置是3T*2,但是近期两块3T硬盘需要另做他用,因此只能用2块1T的硬盘来替换了,所以就免不了要重灌WD的固件.可能是由于设备太老吧,那个 ...
- mysql 日期自动自动添加及更新为当前时间
1. 虽然mysql中日期时间类型比较多,但是支持默认值的类型只有timestamp,详见这里. 2. 希望新增记录时自动写入当前时间,建表语句如下: `create_time` timestamp ...
- 006-nginx.conf详解-error_page 使用
一.概述 nginx指令error_page的作用是当发生错误的时候能够显示一个预定义的uri 1.1.使用步骤 更改nginx.conf在http定义区域加入: proxy_intercept_er ...
- server computer anaconda
star@xmatrix:~/Anaconda$ star@xmatrix:~/Anaconda$ conda create -n wind1 python=3.6Solving environmen ...
- Des加解密工具
import java.security.Key; import java.security.Security; import java.util.Date; import javax.crypto. ...