Nginx配置文件示例
Nginx配置文件示例
nginx.conf
load_module modules/ngx_http_image_filter_module.so;user root;
worker_processes 1;error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;events {worker_connections 1024;
}http {include /etc/nginx/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 /var/log/nginx/access.log main;client_max_body_size 200m;sendfile on;#tcp_nopush on;keepalive_timeout 65;gzip on;include /etc/nginx/conf.d/*.conf;proxy_cache_path ./web_cache levels=1:2 keys_zone=web_cache:1024m inactive=1000m max_size=1g;upstream cwbase {server 172.18.231.224:10000 weight=10 max_fails=3 fail_timeout=30s;}upstream fileview {server 172.18.231.224:30000 weight=10 max_fails=3 fail_timeout=30;server 172.18.231.224:30001 weight=10 max_fails=3 fail_timeout=30;server 172.18.231.224:30002 weight=10 max_fails=3 fail_timeout=30;}server {listen 80;listen 443 ssl;server_name www.shengtai.club;ssl_certificate /cert/www.shengtai.club.pem;ssl_certificate_key /cert/www.shengtai.club.key;ssl_session_timeout 5m;ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;ssl_protocols TLSv1 TLSv1.1 TLSv1.2;ssl_prefer_server_ciphers on;root /usr/share/nginx/html;gzip on;gzip_min_length 1k;gzip_comp_level 3;gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png application/vnd.ms-fontobject font/ttf font/opentype font/x-woff image/svg+xml;gzip_vary on;gzip_disable "MSIE [1-6]\.";gzip_buffers 32 4k;gzip_http_version 1.0;location ^~ /api {rewrite ^/(.*) /$1 break;add_header 'Access-Control-Allow-Credentials' 'true';add_header 'Access-Control-Allow-Methods' 'OPTION, POST, GET, DELETE, PUT';add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type';proxy_redirect off;proxy_set_header Host $host;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://cwbase/;}location ^~ /apis/ {add_header 'Access-Control-Allow-Credentials' 'true';add_header 'Access-Control-Allow-Methods' 'OPTION, POST, GET, DELETE, PUT';add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type';proxy_redirect off;proxy_set_header Host $host;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://cwbase/api/;}location ^~ /jeecg-boot {proxy_pass http://172.18.231.224:8080/jeecg-boot/;proxy_set_header Host 172.18.231.224;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;add_header 'Access-Control-Allow-Credentials' 'true';add_header 'Access-Control-Allow-Methods' 'OPTION, POST, GET, DELETE, PUT';add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type';proxy_connect_timeout 1800s;proxy_send_timeout 1800s;proxy_read_timeout 1800s;}location ^~ /sys/ {add_header 'Access-Control-Allow-Credentials' 'true';add_header 'Access-Control-Allow-Methods' 'OPTION, POST, GET, DELETE, PUT';add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type';proxy_redirect off;proxy_set_header Host $host;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass https://www.shengtai.club/jeecg-boot/sys/;}location ^~ /unsafe {add_header Cache-Control no-cache;proxy_set_header Host www.shengtai.club;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Real-IP $remote_addr;proxy_pass http://www.shengtai.club:1000/unsafe/;proxy_connect_timeout 30s;} location ^~ /jeecg-boot/sys/common/view {alias /root/jeecg/upFiles/;index index.html index.htm;}location ^~ /jenkins {proxy_pass http://172.18.231.224:8080/jenkins/;proxy_set_header Host 172.18.231.224;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;}location ^~ /files {root /root/jeecg/upFiles/;index index.html index.htm;}location ~* /files/(.+)\.(jpg|jpeg|gif|png)!(\d+)x(\d+)$ {set $w $3;set $h $4;image_filter resize $w $h;image_filter_buffer 100M;image_filter_jpeg_quality 75;try_files /files/$1.$2 /notfound.jpg;#expires 30d;}location / {root /usr/share/nginx/html;index index.html index.htm;if (!-e $request_filename) {rewrite ^(.*)$ /index.html?s=$1 last;break;}add_header 'Access-Control-Allow-Credentials' 'true';add_header 'Access-Control-Allow-Methods' 'OPTION, POST, GET, DELETE, PUT';add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type';proxy_cache web_cache;proxy_cache_valid 200 206 304 301 302 10d;proxy_cache_key $scheme$host$request_uri;proxy_connect_timeout 1800s;proxy_send_timeout 1800s;proxy_read_timeout 1800s;expires 30d;}}server {listen 80;listen 443 ssl;server_name erp.brc-beei.com;#access_log logs/host.access.log main;client_max_body_size 100m;#ssl on;ssl_certificate /cert/erp.brc-beei.com-crt.pem;ssl_certificate_key /cert/erp.brc-beei.com-key.pem;ssl_session_timeout 5m;ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;ssl_protocols TLSv1 TLSv1.1 TLSv1.2;ssl_prefer_server_ciphers on;error_page 404 500 502 503 504 http://view.brc-beei.com:6869/error.html;location / {add_header Cache-Control no-cache;proxy_set_header Host gsp.brc-ulife.com;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Real-IP $remote_addr;proxy_pass http://47.106.8.242:8082/;#proxy_connect_timeout 30s;index login.aspx;proxy_connect_timeout 1800s;proxy_send_timeout 1800s;proxy_read_timeout 1800s;client_max_body_size 100m;proxy_cache web_cache;proxy_cache_valid 200 304 1m;proxy_cache_key $scheme$host$request_uri;} }server {listen 80;listen 443 ssl;server_name thumbor.shengtai.club;index index.html index.htm;ssl_certificate /cert/thumbor.shengtai.club.pem;ssl_certificate_key /cert/thumbor.shengtai.club.key;ssl_session_timeout 5m;ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;ssl_protocols TLSv1 TLSv1.1 TLSv1.2;ssl_prefer_server_ciphers on;location / {add_header Cache-Control no-cache;proxy_pass http://www.shengtai.club:1000;proxy_set_header Host thumbor.shengtai.club;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Real-IP $remote_addr;proxy_connect_timeout 1800s;proxy_send_timeout 1800s;proxy_read_timeout 1800s;}}server {listen 80;listen 443 ssl;server_name office.shengtai.club;index index.html index.htm;ssl_certificate /cert/office.shengtai.club.pem;ssl_certificate_key /cert/office.shengtai.club.key;ssl_session_timeout 5m;ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;ssl_protocols TLSv1 TLSv1.1 TLSv1.2;ssl_prefer_server_ciphers on;location / {add_header Cache-Control no-cache;proxy_pass http://172.18.231.224:8002;proxy_set_header Host thumbor.shengtai.club;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Real-IP $remote_addr;proxy_connect_timeout 1800s;proxy_send_timeout 1800s;proxy_read_timeout 1800s;}}server {listen 80;listen 443 ssl;server_name fileview.shengtai.club;index index.html index.htm;ssl_certificate /cert/fileview.shengtai.club.pem;ssl_certificate_key /cert/fileview.shengtai.club.key;ssl_session_timeout 5m;ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;ssl_protocols TLSv1 TLSv1.1 TLSv1.2;ssl_prefer_server_ciphers on;location / {add_header Cache-Control no-cache;proxy_pass http://fileview/;proxy_connect_timeout 1800s;proxy_send_timeout 1800s;proxy_read_timeout 1800s;proxy_set_header Host fileview.shengtai.club;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Real-IP $remote_addr;}}}
Nginx配置文件示例相关推荐
- Nginx反向代理与负载均衡等配置文件示例
Nginx反向代理于负载均衡等配置文件示例 Nginx.conf配置文件 worker_processes 8;events {worker_connections 1024; }http {incl ...
- 【Nginx】Nginx配置文件参数/启动参数详解;启动/停止/重新加载配置命令
nginx配置文件 nginx及其模块的工作方式是由配置文件指定,默认情况下配置文件被命名为nginx.conf并且存放在/usr/local/nginx/conf或者 /etc/nginx或者 /u ...
- 创建NGINX Plus和NGINX配置文件
创建NGINX Plus和NGINX配置文件 NGINX和NGINX Plus与其他服务类似,因为它们使用以特定格式编写的基于文本的配置文件.默认情况下,该文件名为nginx.conf,对于NGINX ...
- nginx 配置示例_Nginx位置指令示例
nginx 配置示例 The location directive within NGINX server block allows to route request to correct locat ...
- Nginx配置文件中location配置
[标题]:Nginx location "/" 配置 服务访问 服务请求如下(示例): nginx服务: http://127.0.0.1:80 后台服务:http://127.0 ...
- nginx配置文件简介
一.配置文件介绍 在nginx的安装目录下的conf文件夹中,名为nginx.conf的文件保存着nginx的相关配置,其中包含了一些基础配置和配置示例(使用#号做了注释),我们可以根据需求进行配置. ...
- Mac Nginx 配置文件使用(nginx.conf,包含M系列)
一.Mac Nginx 安装 二.nginx.conf 配置文件使用 配置文件路径为: /usr/local/etc/nginx/nginx.conf# M1 系统路径 /opt/homebrew/e ...
- nginx配置文件rewrite规则
nginx配置文件rewrite规则 文章目录 nginx配置文件rewrite规则 @[toc] if Rewite 规则介绍 flag标志位 配置rewrite规则 last二次转发 if 语法: ...
- nginx配置文件详解(三)
nginx配置文件详细解析 nginx安装目录: /usr/local/nginx 配置文件: /usr/local/nginx/conf 目录下的 nginx.conf文件 nginx优化方法 ...
最新文章
- C++标准库中sstream和strstream的区别
- Kubernetes(基础 一):进程
- bash编程-循环控制的结构
- 常用的meta标签总结
- gazebo卡了_ardupilot gazebo打开卡死解决办法
- modelsim与modelsim_altera使用的一些区别
- android 框架LoonAndroid,码农偷懒专用(2014/8/6更新)
- The Moving Points
- java stream foreach_Java 8 Lambda Stream forEach具有多个语句
- 找对象年龄差多大最好_女生找对象到底最看重什么?调查了全球6万多名女性的结果是......
- linux网络安装gtk2,(一) linux 下gtk2,python的安装
- 亲临ACM MM大会现场,围观各路技术高手参会心得
- BZOJ3729: Gty的游戏(伪ETT)
- softmax分类(多项逻辑回归)的Pyhon实现及其与SVM的比较
- Java基础-四大特性理解(抽象、封装、继承、多态)
- ISO18000-6B和ISO18000-6C(EPC C1G2)标准的区别
- 谷歌地图坐标转换为百度地图坐标
- 专用计算机的运行速度,WIN10专业版下电脑运行速度慢多个解决技巧
- 无人机加入海上搜救;信息检索一站式开发包;JAX 实现的模块化强化学习库;动物园实际场景多视数据集;前沿论文 | ShowMeAI资讯日报
- Logstash的filter插件-Dissect