您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

nginx 跳转指定接口

2025/11/7 2:38:21发布18次查看
nginx 跳转指定接口
场景:
进行stub测试时,程序访问的不是真正的接口,而是stub接口(提供假数据).
但是程序中写的域名,不可能写stub的ip.
如果写死stub的ip,那么到时候上线时还得改代码.(只要动代码,就是有风险的)
所以就需要做一个映射.
使用nginx 实现这个功能
配置文件名称:yunmasoft.com.conf
配置文件内容:
server { listen 80; server_name yunmasoft.com www.yunmasoft.com; if ( $uri ~* ^/user/logininput$ ) { rewrite ^/(.*)$ http://123.57.250.51/$1 redirect; } location / { proxy_pass http://182.92.97.72:8083;# proxy_redirect on ;indexindex.php index.html index.htm; } error_page 500502503504 /50x.html;}
参考:http://hw1287789687.iteye.com/admin/blogs/2279741
').addclass('pre-numbering').hide(); $(this).addclass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadein(1700); }); }); 以上就介绍了nginx 跳转指定接口,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product