Nginx项目笔记

Nginx项目笔记

复制代码
#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;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    
    ## include nginx-parcels.conf;

    proxy_set_header Host       $host;
    client_max_body_size    1000m;

    #gzip  on;

    
    upstream parcels-web{
        server 127.0.0.1:8022 weight=5 max_fails=2 fail_timeout=600s;
    }

    upstream export-data{
        server 127.0.0.1:8032 weight=5 max_fails=2 fail_timeout=600s;
    }
    
    upstream label-ex{
        server 127.0.0.1:8028 weight=5 max_fails=2 fail_timeout=600s;
    }
    
    upstream label-ex-eu{
        server 47.254.158.111:8028 weight=5 max_fails=2 fail_timeout=600s;
    }
    
    upstream static-web{
        server 192.168.8.168:80 weight=5 max_fails=2 fail_timeout=600s;
    }
    
    upstream nuxt-home{
        server 127.0.0.1:4006 weight=5 max_fails=2 fail_timeout=600s;
    }
    
    
    server {
        listen       80;
        server_name  ~^export\.(.+)?\.(com|com.cn|tech|cn)$;    
        
        location /export {
            proxy_pass http://export-data;
        }
        
    }
    
    server {
        listen       80;
        server_name  ~^author\.(.+)?\.(com|com.cn|tech|cn)$;
        
        location ~\.(html|js|css|png|gif|icon|jpg|ttf|woff|woff2|properties|eot|svg|php|ico|map|swf|asp|php|aspx|jsp|do|action|shtml|htm|txt|apk|json)$ {
            root I:/eship/code/vue-author-center/dist;
            index index.html;
        }        
        
        
        location /export {
            proxy_pass http://export-data;
        }
        
        location / {
            proxy_pass http://parcels-web;
        }
        
        location =/{
          rewrite / /index.html break;
          root I:/eship/code/vue-author-center/dist;
        }
    }
    
    server {
        listen       80;
        server_name  ~^label-ex\.(.+)?\.(com|com.cn|tech|cn)$;
        
        #location ~* /DpdService$ {
        #    proxy_pass http://label-ex-eu;
        #}
        
        location / {
            proxy_pass http://label-ex;
        }

    }
    
    server {
        listen       80;
        server_name  ~^finance\.(.+)?\.(com|com.cn|tech|cn)$;
        
        proxy_read_timeout 600s;
        proxy_send_timeout 120s;
        
        location ~\.(html|js|css|png|gif|icon|jpg|ttf|woff|woff2|properties|eot|svg|php|ico|map|swf|asp|php|aspx|jsp|do|action|shtml|htm|txt|apk|json)$ {
            root   I:/eship/code/vue-finance-center/dist;
            index index.html;
        }
        
        location /export {
            proxy_pass http://export-data;
        }        
        
        location / {
            proxy_pass http://parcels-web;
        }
        
        location =/{
          rewrite / /index.html break;
          root I:/eship/code/vue-finance-center/dist;
        }
       
    }
    
    server {
        listen       80;
        server_name  ~^operation\.(.+)?\.(com|com.cn|tech|cn)$;
    

        location ~\.(html|js|css|png|gif|icon|jpg|ttf|woff|woff2|properties|eot|svg|php|ico|map|swf|asp|php|aspx|jsp|do|action|shtml|htm|txt|apk|json)$ {
            root   I:/eship/code/vue-operation-center/dist;
            index index.html;
        }
        
        location /export {
            proxy_pass http://export-data;
        }
        
        location / {
            proxy_pass http://parcels-web;
        }
        
        location =/{
          rewrite / /index.html break;
          root I:/eship/code/vue-operation-center/dist;
        }
       
    }
    

    server {
        listen       80;
        server_name  ~^sales\.(.+)?\.(com|com.cn|tech|cn)$;
        

        location ~\.(html|js|css|png|gif|icon|jpg|ttf|woff|woff2|properties|eot|svg|php|ico|map|swf|asp|php|aspx|jsp|do|action|shtml|htm|txt|apk|json)$ {
            root   I:/eship/code/vue-service-sales-center/dist;
            index index.html;
        }
        
        location /export {
            proxy_pass http://export-data;
        }
        
        location / {
            proxy_pass http://parcels-web;
        }

        
        location =/{
          rewrite / /index.html break;
          root I:/eship/code/vue-service-sales-center/dist;
        }
       
    }
    
    
    server {
        listen       80;
        server_name  ~^product\.(.+)?\.(com|com.cn|tech|cn)$;


        location ~\.(html|js|css|png|gif|icon|jpg|ttf|woff|woff2|properties|eot|svg|php|ico|map|swf|asp|php|aspx|jsp|do|action|shtml|htm|txt|apk|json)$ {
            root   I:/eship/code/vue-product-center/dist;
                index index.html;
        }
        
        location /export {
            proxy_pass http://export-data;
        }
        
        location / {
            proxy_pass http://parcels-web;
        }
    
        location =/{
          rewrite / /index.html break;
          root I:/eship/code/vue-product-center/dist;
        }
       
    }


    server {
        listen       80;
        server_name  ~^customer\.(.+)?\.(com|com.cn|tech|cn)$;
        
        
        location ~\.(html|js|css|png|gif|icon|jpg|ttf|woff|woff2|properties|eot|svg|php|ico|map|swf|asp|php|aspx|jsp|do|action|shtml|htm|txt|apk|json)$ {
            root   D:\3-git\vue-customer-center\dist;
            index index.html;
        }

        location /export {
            proxy_pass http://export-data;
        }

        location / {
            proxy_pass http://parcels-web;
        }
        
        location =/{
          rewrite / /index.html break;
          root D:\3-git\vue-customer-center\dist;
        }
       
    }
    

    server {
        listen       80;
        server_name  ~^warning\.(.+)?\.(com|com.cn|tech|cn)$;
        
        location / {
            root /home/eship/code/vue-warning-center/dist;
            index index.html;
        }

        location /export {
            proxy_pass http://export-data;
        }
        
        location /auth {
            proxy_pass http://parcels-web;
        }
        
        location =/{
          rewrite / /index.html break;
          root /home/eship/code/vue-warning-center/dist;
        }
    }


    server {
        listen       80;
        server_name  ~^api\.(.+)?\.(com|com.cn|tech|cn)$;
        
        location / {
            proxy_pass http://parcels-web;
        }
    }
    

    ## nuxt-home    
    server {
        listen       80;
        server_name ~^home\.(eship|17feia|weaship|parcels|51kj56)\.(com|com\.cn)$;


        location / {
             proxy_pass http://nuxt-home;
        }
    }
    
    
    # 静态文件服务器
    server {
        listen       80;
        server_name ~^static\.(.+)?\.(com|com.cn|tech|cn)$;
        
        location / {
            proxy_pass http://static-web;
        }
    }
}
复制代码

 

posted @   yifanSJ  阅读(228)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示