nginx jumps to the specified interface
nginx 跳转指定接口
场景:
进行stub测试时,程序访问的不是真正的接口,而是stub接口(提供假数据).
但是程序中写的域名,不可能写stub的ip.
如果写死stub的ip,那么到时候上线时还得改代码.(只要动代码,就是有风险的)
所以就需要做一个映射.
使用nginx 实现这个功能
配置文件名称:yunmasoft.com.conf
配置文件内容:
<code><span>server</span> { listen <span>80</span>; server_name yunmasoft.com www.yunmasoft.com; <span>if</span> ( $uri ~* <span>"^/user/loginInput$"</span> ) { rewrite ^/(.*)$ http:<span>//123.57.250.51/$1 redirect;</span> } location / { proxy_pass http:<span>//182.92.97.72:8083;</span><span># proxy_redirect on ;</span><span>index</span><span>index</span>.php <span>index</span>.html <span>index</span>.htm; } error_page <span>500</span><span>502</span><span>503</span><span>504</span> /<span>50</span>x.html; }</code>
参考:http://hw1287789687.iteye.com/admin/blogs/2279741
以上就介绍了nginx 跳转指定接口,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

To learn more about open source, please visit: 51CTO Hongmeng Developer Community https://ost.51cto.com Running environment DAYU200:4.0.10.16SDK: 4.0.10.15IDE: 4.0.600 1. To create an application, click File- >newFile->CreateProgect. Select template: [OpenHarmony] EmptyAbility: Fill in the project name, shici, application package name com.nut.shici, and application storage location XXX (no Chinese, special characters, or spaces). CompileSDK10, Model: Stage. Device

The difference between comcn and com: 1. There are differences between comcn and com in terms of meaning, but there is no difference in access speed; 2. comcn is an international domain name and is a global top-level domain name for use by commercial institutions, while cn is a Chinese company domain name , domestic commercial institutions, domestic domain names, only enterprises can register; 3. The search priority is that cn will search for .cn first. After finding the .cn server, the .cn server will then search for .com; 4. cn is provided by cnnic China Internet Center Management, com's management organization is abroad.

目录1:basename()2:copy()3:dirname()4:disk_free_space()5:disk_total_space()6:file_exists()7:file_get_contents()8:file_put_contents()9:filesize()10:filetype()11:glob()12:is_dir()13:is_writable()14:mkdir()15:move_uploaded_file()16:parse_ini_file()17:

1. Apply for the interface through https://www.juhe.cn/docs/api/id/54. Self-service application to open the SMS API and obtain the interface request key. (Currently, the interface only supports enterprise users.) After applying, submit a text message template in the personal center. The official aggregation has provided a number of commonly used templates, which can be quickly applied for. 2. For the official interface document of python code example, please refer to: Https://www.juhe.cn/docs/api/id/54#!/usr/bin/Python#-*-coding:utf-8-*-importurllib, urllib2,sys,JSONreload(

This article will explain in detail how to add classes in Jquery? , the editor thinks it is quite practical, so I share it with everyone as a reference. I hope everyone can gain something after reading this article. Two common methods for adding classes in jQuery 1. addClass() method The addClass() method adds one or more classes to the selected element. The syntax is as follows: $(selector).addClass(classNames); where: selector: the element selector to add the class. classNames: Classes to add, can be a single string or a space-separated list of strings. For example, the following code adds ac to the element with the ID my-element

Table of Contents What is DI/Dependency Injection Reasons for Dependency Injection Simple Dependency Injection High-Order Dependency Injection Application of Dependency Injection High-Order Optimization What is DI/Dependency Injection Dependency Injection DI actually refers to the dependence on classes through construction In layman's terms, it means that you are currently operating a class, but some methods or functions of this class cannot be completed by this class alone, but are the most direct sign that it can be completed with the help of another class. That is when the parameter data is passed as an object. Strictly speaking, you want to operate one class in another class. There is an interdependence between the two classes. The method of passing parameters is called injection. The reason why dependency injection occurs is that when dependency injection is not used, PHP needs to be in a When a class uses another class

We will learn to create an authentication system using Laravel's PassportapiOAuth. Step 1. Install Laravel We need to use the following command to create a latest Laravel application, so please open the terminal and execute: laravelnewauth Step 2. Install the LaravelPassport package LaravelPassport can implement a complete OAuth2 server for your application in a few minutes. composerrequirelaravel/passport Step 3. Run database migration Passport migration will create your application to store the client and AccessToke

PHP is a powerful programming language that is widely used in the development of web applications and desktop applications. However, when using PHP, you may encounter some errors and exceptions. This article will focus on the solution to "PHPFatalerror: Class'COM'notfound". Positioning Problem First, we need to understand the source of the error and the positioning problem. This error usually means that you are trying to use a COM extension in your code, but when loading the parser
