苍穹容器部署内网,需要代理访问外网问题原创
金蝶云社区-Infinity
Infinity
12人赞赏了该文章 1,283次浏览 未经作者许可,禁止转载编辑于2022年02月23日 21:08:56

内网环境,用代理转发请求访问外网,需要在web配置文件和mservice配置文件里面都增加      hostAliases:      - hostnames:        - api.kingdee.com        ip: 10.228.9.46,ip为跳转机地址,

nginx的conf配置:


#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;

}



stream {

    resolver 114.114.114.114;

    server {

        listen 443;

        ssl_preread on;

        proxy_connect_timeout 5s;

        proxy_pass $ssl_preread_server_name:$server_port;

    }

}




http {


    include       mime.types;

    default_type  application/octet-stream;

    client_max_body_size   100m;


    log_format main '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for" "$upstream_response_time"';

    map $http_user_agent $samesite_none { "~*chrome/[8|9].*" ';httponly; secure; SameSite=NONE'; default ';httponly; secure;'; }

    proxy_headers_hash_max_size 51200;

   proxy_headers_hash_bucket_size 6400;

    sendfile        on;

    gzip    on;

    gzip_buffers   4 8k;

    gzip_comp_level 2;

    gzip_min_length 1000;

    gzip_types text/plain text/json text/css application/x-httpd-php application/json application/x-javascript application/javascript text/xml application/xml application/xml+rss text/javascript image/png image/jpg image/jpeg image/gif image/bmp;

    server_tokens off;

    keepalive_timeout  65;


server {

        listen 80;

        resolver 119.29.29.29;

        location /{

            proxy_pass http://$host$request_uri;

            proxy_set_header HOST $host:80;

            proxy_buffers 256 4k;

            proxy_max_temp_file_size 1024k;

            proxy_connect_timeout 1800;

            proxy_send_timeout 1800;

            proxy_read_timeout 1800;

            proxy_next_upstream_tries 0;

    }

}

}


图标赞 12
12人点赞
还没有人点赞,快来当第一个点赞的人吧!
图标打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!

您的鼓励与嘉奖将成为创作者们前进的动力,如果觉得本文还不错,可以给予作者创作打赏哦!

请选择打赏金币数 *

10金币20金币30金币40金币50金币60金币
可用金币: 0