美文网首页
nginx windows 和 linux 的反向代理

nginx windows 和 linux 的反向代理

作者: me_6b3f | 来源:发表于2021-03-16 23:03 被阅读0次

    windows

     
    #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;
       #tcp_nopush     on;
    
       #keepalive_timeout  0;
       keepalive_timeout  65;
    
       #gzip  on;
    
       server {
           listen       80;
           server_name  localhost;
    
           #charset koi8-r;
    
           #access_log  logs/host.access.log  main;
    
           location / {
               root   html;
               index  index.html index.htm;
           }
    
    
           error_page   500 502 503 504  /50x.html;
           location = /50x.html {
               root   html;
           }
    
    
    
       }
       
       server {
           listen          84;
           server_name     192.168.41.51;
    
           location / {
    
               root E:/html/super_manage/nantong/dist;
               index index.html index.htm;
    
    
           }
      }
       
    
           server {
           listen          9095;
           server_name     192.168.41.51;
    
           location / {
    
               root E:/html/super_manage/nantong/dist;
               #允许跨域请求的域,*代表所有
               add_header 'Access-Control-Allow-Origin' *;
               try_files $uri $uri/ /index.html;
               error_page 404 /index.html;
    
           }
    
           location /tomcat/ {
             proxy_pass http://117.71.48.144:9090/obix/;
    
             proxy_connect_timeout   600s;
             proxy_send_timeout      600s;
             proxy_read_timeout      600s;
             proxy_buffer_size       16k;
             proxy_buffers           4 64k;
             proxy_busy_buffers_size 128k;
             proxy_temp_file_write_size 128k;
             proxy_max_temp_file_size 1024m;
             client_max_body_size 100m;
             index index.jsp index.html index.htm;
       }
    
           error_page   500 502 503 504  /50x.html;
           location = /50x.html {
               root   html;
           }
       }
       
       
    
    }
    

    linux

    user  nginx;
    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;
    
        sendfile        on;
        #tcp_nopush     on;
    
        keepalive_timeout  65;
    
        #gzip  on;
        
    
       server {
            listen       80;
            server_name  192.168.1.99;
    
            location / {
                root /home/html/kq/dist;
            }
           
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
      
       server {
            listen       81;
            server_name  192.168.1.99;
    
            location / {
                root /home/img;
              
            }
    
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
    
       server {
            listen   9097;
            server_name  192.168.1.99;
            
            location / {
               root /chinaatech/service/sxs/dist;
                try_files $uri $uri/ /index.html;
            }
            
           location /sxs {
            proxy_pass http://192.168.1.99:9199/sxs;
        }
     
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
    
        server {
                listen   9197;
                server_name  192.168.1.99;
                
                location / {
                   root /chinaatech/service/jh/jinhe/dist;
                    try_files $uri $uri/ /index.html;
                }
                
        
         
                error_page   500 502 503 504  /50x.html;
                location = /50x.html {
                    root   html;
                }
            }
    
      server {
            listen       83;
            server_name  192.168.1.99;
    
            location / {
                root   /chinaatech/service/visit/dist;
            }
    
        location /visitor {
            proxy_pass http://192.168.1.99:9099/visitor;
        }
    
            location /update {
                proxy_pass http://192.168.1.99:84/;     
            }
            location /examine {
                proxy_pass http://192.168.1.99:85/;            
            }
            
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
       }
    
    
    
     server {
            listen       84;
            server_name  192.168.1.99;
    
            location / {
                root /home/html/vibration/dist;
    
            }
    
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
    
    
       server {
            listen       85;
            server_name  192.168.1.99;
    
            location / {
                root /home/html/xa/dist;
            
            }
    
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
    
       server {
            listen       86;
            server_name  192.168.1.99;
    
            location / {
                root /home/html/wl/dist/dist;
    
            }
    
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
       server {
            listen       89;
            server_name  192.168.1.99;
    
            location / {
                root /home/html/wl2/dist;
    
            }
    
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
    
        server {
            listen       96;
            server_name  117.71.48.144;
    
            location / {
                root /home/file;
    
            }
    
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
    
       server {
            listen       98;
            server_name  192.168.1.99;
    
            location / {
                root /home/html/dl/dist;
    
            }
    
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
         
      server {
            listen       99;
            server_name  192.168.1.99;
    
            location / {
                root /home/html/super-manage3.0/dist;
    
            }
    
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
      
       server {
            listen          9092;
        server_name     117.71.48.144;
    
            location / {
    
                root /home/html/super-manage3.0/3.15/dist;
                #允许跨域请求的域,*代表所有
            add_header 'Access-Control-Allow-Origin' *;
                try_files $uri $uri/ /index.html;
            error_page 404 /index.html;
    
            }
    
        location /tomcat/ {
              proxy_pass http://117.71.48.144:9090/obix/;
    
          proxy_connect_timeout   600s; 
          proxy_send_timeout      600s; 
          proxy_read_timeout      600s; 
          proxy_buffer_size       16k; 
          proxy_buffers           4 64k; 
          proxy_busy_buffers_size 128k; 
          proxy_temp_file_write_size 128k;
          proxy_max_temp_file_size 1024m;
          client_max_body_size 100m; 
          index index.jsp index.html index.htm;
        }
    
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
    
        server {
            listen          9095;
            server_name     117.71.48.144;
    
            location / {
    
                root /home/html/super-manage3.0/nantong/dist;
                #允许跨域请求的域,*代表所有
                add_header 'Access-Control-Allow-Origin' *;
                try_files $uri $uri/ /index.html;
                error_page 404 /index.html;
    
            }
    
            location /tomcat/ {
              proxy_pass http://117.71.48.144:9090/obix/;
    
              proxy_connect_timeout   600s;
              proxy_send_timeout      600s;
              proxy_read_timeout      600s;
              proxy_buffer_size       16k;
              proxy_buffers           4 64k;
              proxy_busy_buffers_size 128k;
              proxy_temp_file_write_size 128k;
              proxy_max_temp_file_size 1024m;
              client_max_body_size 100m;
              index index.jsp index.html index.htm;
        }
    
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
    
    
    }
    

    相关文章

      网友评论

          本文标题:nginx windows 和 linux 的反向代理

          本文链接:https://www.haomeiwen.com/subject/rbijcltx.html