zoukankan      html  css  js  c++  java
  • 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;
          }

        }
    }
  • 相关阅读:
    Python图形编程探索系列-07-程序登录界面设计
    英语初级学习系列-05-阶段1总结
    Python图形编程探索系列-06-按钮批量生产函数
    英语初级学习系列-04-年龄
    Python图形编程探索系列-05-用控制变量构建对话程序
    Python图形编程探索系列-04-网上图片与标签组件的结合
    Python图形编程探索系列-03-标签组件(Label)
    Python解释数学系列——分位数Quantile
    Python图形编程探索系列-02-框架设计
    Python图形编程探索系列-01-初级任务
  • 原文地址:https://www.cnblogs.com/loong-hon/p/11065497.html
Copyright © 2011-2022 走看看