Local Proxy
The Reverse Proxy corresponds to the Local Proxy File found in Plateau Studio. A Reverse Proxy serves as an intermediary between client devices (such as web browsers) and backend servers (such as web applications or APIs).
What Is a Reverse Proxy?
A Reverse Proxy works by receiving requests from clients and forwarding them to the appropriate backend servers. Reverse Proxy's main purposes include:
- Load Balancing: Distributing incoming requests across multiple backend servers to improve performance and reliability.
- Security: Filtering requests, blocking malicious traffic, and providing an additional security layer for backend servers.
- Caching: Storing responses from backend servers in a cache to serve them directly to clients, reducing server load.
- SSL Termination: Handling SSL encryption/decryption, offloading this task from the backend servers.
- URL Rewriting: Modifying URLs before forwarding requests.
- Header Manipulation: Adjusting request and response headers.
Why Use a Reverse Proxy?
- There are several reasons to use a Reverse Proxy:
- Privacy and Security: Enhances privacy and security by shielding backend servers from direct exposure and providing an additional defense against potential cyber attacks.
- Accelerating Web Traffic: Speeds up web traffic by distributing the service load across multiple servers and handling additional services like SSL encryption.
- Load Balancing and Scalability: Balances web traffic to maximize speed and capacity, ensuring efficient load distribution and scalability of the application.
Reverse Proxy Example
- NGINX is a popular web server that also functions as a Reverse Proxy. It is commonly used in front of application servers to improve performance, scalability, and security. NGINX excels at handling a large number of simultaneous connections and can cache content to improve performance.
Nginx is an open-source web server software that can be used for various purposes. Here are some use cases for Nginx:
- HTTP Server: Nginx is used to process HTTP requests from clients. It is optimized for serving web pages quickly.
- Reverse Proxy Server: Nginx can be used as a reverse proxy server to securely route network traffic and perform load balancing.
- Email (IMAP/POP3) Proxy Server: Nginx can also serve as an IMAP/POP3 proxy server to handle and route email requests
How To Use Local Proxy File in Plateau Studio?
You can use Local Proxy File in Plateau Studio when calling local service and UI pages.
To access the Local Proxy File:
- Click the + button on the right side of the UI Settings module in the Explorer tab in Plateau Studio.
- Select Local Proxy File in the menu that opens.
You should add the following definition to the Settings File file:
useLocalProxyOnClient: true
Example Local Proxy File
##-----PLEASE DELETE/COMMENT LINES BELOW-----
##------Local proxy redirection samples------
##Sample service redirection (local)
service/campaign-delete/: http://localhost:3002/campaignManagament-sym/campaign-delete
##Sample service redirection (URL)
service/campaign-create/: https://apigateway.myPlatform.onplateau.com/campaignManagament-sym/campaign-create
/api/users: https://reqres.in/api/users
/api/usersError: https://reqres.indd/api/users
/services/demorequest: https://reqres.in/api/users?page=2
##Sample microUI redirection (URL redirection)
/microUI/processmanager: http://URL
##Sample microUI redirection (file system redirection)
/microUI/authorization: ../../authorization/authorizationUI # URL or relative file path(relative to root)
##Sample symphony qjson redirection
/moneytransfer/qjsonfunc: http://localhost:3001/moneytransfer/qjsonfunc
Example Service Request
For the URL in the service request below, add the definition to the Local Proxy File is shown as below:
## Description to add to Local Proxy File
service/campaign-create/: https://apigateway.myPlatform.onplateau.com/campaignManagament-sym/campaign-create
## The URL used in the service request
let requestObject: IRequest = {
url: 'service/campaign-create/',
http: 'post',
data: {
"title": "my Title",
"descriptionDetail": "my Title"
},
responseField: 'data',
onSuccess: 'campaignAddOnSuccess',
onFail: 'campaignAddOnFail',
blockRender: false
}
quick.Request.async(requestObject);