#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; include proxy.conf; 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 70; #keepalive_timeout 65;

upstream kc {
    server localhost:9001;
}

upstream oofs {
    server localhost:9001;
}

#ofs1.7 kc
server {
    listen                30003;
    server_name           localhost;
    error_page 497        https://$host$uri?$args;
    proxy_set_header      Host $host:30003;
    proxy_set_header      X-Real-IP $remote_addr;
    proxy_set_header      X-Forwarded-For $proxy_add_x_forwarded_for;
    client_header_buffer_size 16k;
    large_client_header_buffers 4 6m;

    location = /index.html {
        expires 0d;
        proxy_pass http://kc;
        proxy_redirect off;
    }

    location ~ /css/icon/style.css {
        root C:/ttx/nginx-1.20.2/webapps/ofs-1.7/release; 
        proxy_redirect off;
    } 

    location ~ /(js|css)/(ofs|icon)/ {
        root D:/Projects/kaicun/ofs-kaicun/src/main/resources/static;
        proxy_ignore_headers Set-Cookie Cache-Control;
        proxy_hide_header Cache-Control;
        proxy_hide_header Set-Cookie;
        expires 0d;
    }

    location = / {
        expires 0d;
        proxy_pass http://kc;
        proxy_redirect off;
    }

    location = /html/verifyPage.html {
        root C:/ttx/nginx-1.20.2/webapps/ofs-1.7/release;
    }

    location = /html/authorization.html {
        proxy_pass http://kc;
        proxy_redirect off;
    }

    location = /css/icon/svgxuse.js {
        root C:/ttx/nginx-1.20.2/webapps/ofs-1.7/release;
        proxy_redirect off;
    }

    location ~ /(documents) {
        root D:/Projects/kaicun/ofs-kaicun/src/main/resources/static;
    }

    location ~ /images/changeLogLogo.svg {
        root D:/Projects/kaicun/ofs-kaicun/src/main/resources/static;
    }

    location ~ /css/icon/SVG/ {
        root D:/Projects/kaicun/ofs-kaicun/src/main/resources/static;
    }

    location ~ /images/documents/ {
        root D:/Projects/kaicun/ofs-kaicun/src/main/resources/static;
    }

    location = /cron_qqe2_com.html {
        proxy_pass http://kc;
        proxy_redirect off;
    }

    location ~ /asset/.+$ {
        root C:/ttx/nginx-1.20.2/webapps/ofs-1.7/release;
        proxy_redirect off;
    }

    location ~ /js/lib/.+$ {
        root C:/ttx/nginx-1.20.2/webapps/ofs-1.7/release;
        proxy_redirect off;
    }

    location ~ /js/ttx/.+$ {
        root C:/ttx/nginx-1.20.2/webapps/ofs-1.7/release;
        proxy_redirect off;
    }

    location ~ /master/file/upload/Voucher/ {
        proxy_pass http://kc;
        proxy_redirect off;
    }

    location ~ ^/(ofs.html|images/prod-logo.svg|images/prod-logo-colorful.svg) {
        proxy_pass http://kc;
        proxy_redirect off;
    }

    location ~ ^/(cbt|api|rest|endpoint|userData)/.+$ {
        proxy_pass http://kc;
        proxy_redirect off;
    }

    location ~ /rest/ {
        proxy_pass http://kc;
        proxy_redirect off;
    }

    location ~ ^/(ams|js/ams|css/ams|images/ams)/.+$ {
        proxy_pass http://kc;
        proxy_redirect off;
    }

    location ~ /css/icon/SVG/ {
        proxy_pass http://kc;
        proxy_redirect off;
    }

    location ~ /js/js-xlsx/ {
        proxy_pass http://kc;
        proxy_redirect off;
    }

    location ~ /css/ofs/ {
        root C:/ttx/nginx-1.20.2/webapps/ofs-1.7/release;
        proxy_redirect off;
    }

    location ~ ^/(js|css|images)/(ams|bms|datax|demo|ofs|oms|ots|kpi|scv|tms|tb|tf|wms|customization|sso-admin)/.+$ {
        proxy_pass http://kc;
        proxy_redirect off;

        add_header Last-Modified $date_gmt;
        add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
        add_header Cache-Control private;

        if_modified_since off;
        expires off;
        etag off;
    }

    location ~ .*\.(html|gif|jpg|ico|jpeg|png|bmp|swf|js|json|css|woff|woff2|ttf|html|coffee|map|mp3|wav|svg|ttf)$ {
        expires modified +2d;
        root C:/ttx/nginx-1.20.2/webapps/ofs-1.7/release;
    }

    location ~ .*\.(js|css)?$ {
        proxy_pass http://kc;
        proxy_redirect off;
    }

    location ~ ^/.+$ {
        proxy_pass http://kc;
    }

    location ~ ^/(WEB-INF)/ {
        deny all;
    }

    error_page 500 502 503 504 /50x.html;

    location = /50x.html {
        root html;
    }
}

#oofs 产品
server {
    listen                30001;
    server_name           localhost;
    error_page 497        https://$host$uri?$args;
    proxy_set_header      Host $host:30001;
    proxy_set_header      X-Real-IP $remote_addr;
    proxy_set_header      X-Forwarded-For $proxy_add_x_forwarded_for;
    client_header_buffer_size 16k;
    large_client_header_buffers 4 6m;

    location = /index.html {
        expires 0d;
        proxy_pass http://oofs;
        proxy_redirect off;
    }

    location ~
#user nobody;worker_processes 1;#error_log logserrorlog;#error_log logserrorlog notice;#error_log logserrorlog info;#pid logsnginxpid;events worker_connections 1024;http include

原文地址: https://www.cveoy.top/t/topic/eEWF 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录