ng反向代理 conf配置

ops/2024/10/19 5:26:16/
java">log_format szxw_timed_combined '$remote_addr - $remote_user [$time_local] "$request" ''$status $body_bytes_sent "$http_referer" ''"$http_user_agent" "$http_x_forwarded_for" $request_time $upstream_response_time';#外部转发
server {listen      7999;server_name  localhost;#log_format timed_combined '$request_time';access_log  logs/szxw.access.log szxw_timed_combined;underscores_in_headers on;send_timeout 60s;client_header_timeout 60s;client_body_timeout 60s;client_max_body_size 4096m;client_body_buffer_size 4096m;	#e签宝location ^~ /esign{rewrite ^/esign/(.*)$ /$1 break;proxy_pass  https://smlopenapi.esign.cn;proxy_http_version 1.1;proxy_read_timeout 320s;proxy_connect_timeout 75s;#proxy_set_header Host "rds-t.baihangcredit.com";#proxy_set_header Upgrade $http_upgrade;#proxy_set_header Connection "Upgrade";#proxy_set_header X-real-ip $remote_addr;#proxy_set_header X-Forwarded-For $remote_addr;}#e签宝location ^~ /tsign{rewrite ^/tsign/(.*)$ /$1 break;proxy_pass  http://smlitsm.tsign.cn:8080;proxy_http_version 1.1;proxy_read_timeout 320s;proxy_connect_timeout 75s;}#e签宝location /openapi_tech{proxy_pass  http://smltech.tsign.cn:8080;proxy_http_version 1.1;proxy_read_timeout 120s;proxy_connect_timeout 75s;}}

部分:

java"> #e签宝location ^~ /tsign{rewrite ^/tsign/(.*)$ /$1 break;proxy_pass  http://smlitsm.tsign.cn:8080;proxy_http_version 1.1;proxy_read_timeout 320s;proxy_connect_timeout 75s;}

意思是访问路径有/tsign的,通过rewrite 用proxy_pass 的值拼上/tsign后面的值
还有种写法:

java"> #e签宝location /tsign{proxy_pass  http://smlitsm.tsign.cn:8080/;proxy_http_version 1.1;proxy_read_timeout 320s;proxy_connect_timeout 75s;}

这两种写法同效,但如果访问路径不想过滤掉 /tsign
就写成:

java"> #e签宝location  /tsign{proxy_pass  http://smlitsm.tsign.cn:8080;proxy_http_version 1.1;proxy_read_timeout 320s;proxy_connect_timeout 75s;}

注意:proxy_pass后面没有/
修改完conf后要重启才生效
在这里插入图片描述


http://www.ppmy.cn/ops/10431.html

相关文章

简单了解 HTTP 基础知识

HTTP(Hypertext Transfer Protocol,超文本传输协议)是用于在网络上传输数据的一种协议,对于网络开发人员来说,理解这一协议是至关重要的。由于其广泛的应用,除了在网页应用传输数据之外,它还被应…

BI建设案例:FineBI大数据分析平台助力工程机械行业降本增效

工程机械行业作为国民经济的重要支柱,产品多样化、应用广泛,市场集中度高。其上游涉及原材料和核心零部件,下游则与房地产、基建工程和采矿等行业紧密相连。 如今,中国已崛起为全球工程机械制造大国,各类机械产品产量…

CSS3 animation-direction 属性

CSS3 animation-direction 属性 定义和用法 animation-direction 属性定义是否循环交替反向播放动画。 **注意:**如果动画被设置为只播放一次,该属性将不起作用。 默认值:normal继承:否可动画化:否。请参阅 可动画…

Flutter 插件站新升级: 加入优秀 GitHub 开源项目

Flutter 插件站新升级: 加入优秀 GitHub 开源项目 视频 https://youtu.be/qa49W6FaDGs https://www.bilibili.com/video/BV1L1421o7fV/ 前言 原文 https://ducafecat.com/blog/flutter-awesome-github-repo-download 这几天晚上抽空把 Flutter 插件站升级,现在支…

【北京迅为】《iTOP-3588开发板系统编程手册》-第16章 串口应用编程

RK3588是一款低功耗、高性能的处理器,适用于基于arm的PC和Edge计算设备、个人移动互联网设备等数字多媒体应用,RK3588支持8K视频编解码,内置GPU可以完全兼容OpenGLES 1.1、2.0和3.2。RK3588引入了新一代完全基于硬件的最大4800万像素ISP&…

ardupilot开发 --- 机载(边缘)计算机-VISP高阶 篇

让我再看你一眼从南到北 0. 基础1. 视觉伺服1.1 视觉伺服基础1.1.1 基本理论1.1.2 代码解析(tutorial-ibvs-4pts.cpp): 1.2 基于图像处理的视觉伺服 0. 基础 基础知识点请参考基础篇。 1. 视觉伺服 参考:Visual servoing 1.1 视觉伺服基础 参考1&am…

vscode微博发布案例

样例: CSS代码: * {margin: 0;padding: 0; }ul{list-style: none; }.w {width: 900px;margin: 0 auto; }.controls textarea {width: 878px;height: 100px;resize: none;border-radius: 10px;outline: none;padding-left: 20px;padding-top: 10px;font-size: 18px; }.controls…

数字孪生与人工智能

在一个遥远的星系中,有一个被称为“预言者”的古老文明。他们能够准确预测未来的每一个事件,无论是星球的运行,还是生命的轨迹。他们的秘密?一个强大的工具,能够创建宇宙中每一个物体的精确数字副本,并通过…