NGINX
How to publish a Wisej App using NGINX as a reverse proxy.
Deploying a Wise 2 application on NGINX is similar the the IIS deployment in regards to the files to copy to the production machine:

Basic Steps

  1. 1.
    Create the application directory on the deployment server
  2. 2.
    Create the /bin directory in the application's directory on the deployment server
  3. 3.
    Copy all the assemblies from your local /bin to the server's /bin (no need to copy xml and pdb files)
  4. 4.
    Copy the /Themes folder if you have custom themes or mixins
  5. 5.
    Copy the /Images folder if you have images that need to be served as URLs
  6. 6.
    Copy the /App_Data folder if your application uses it
  7. 7.
    Copy Web.config
  8. 8.
    Copy Default.html (and other html files you use sub-applications)
  9. 9.
    Copy Default.json (and other json configuration files if you use sub-applications)
  10. 10.
    Copy favicon.ico.
Notice that step 1 is different from IIS because NGINX never loads the actual application, instead it acts as a Reverse Proxy dispatching requests to the web application listening on a another internal port.
The actual Wisej application must be running and listening for requests in a separate process on the local machine or a remote machine. It can be either another IIS process, or a Self Hosted process (may also run in a Docker container).
All NGINX needs is an address and a port. In the nginx.conf file define the URL for your application and assign the URL:port of the actual Wisej application to the proxy_pass setting.
1
http {
2
3
server {
4
listen 80;
5
6
location /myapp/ {
7
# Location of the Wisej server.
8
proxy_pass http://10.1.10.112:43662;
9
}
10
}
11
}
Copied!
The configuration in this book are minimal examples, use the full NGINX guide to determine how to be configure your NGINX server.
NGINX Reverse Proxy
nginx
NGINX Reverse Proxy Setup
This is all you need for NGINX to dispatch the requests to the Wisej application.

Load Balancer

NGINX can also serve as a load balancer out of the box. Instead of setting the proxy_pass property to the actual Wisej server, assign it to an upstream configuration group that defines the load balancing rotation.
1
http {
2
3
upstream myapp1 {
4
ip_hash;
5
server 10.1.10.1:52433;
6
server 10.1.10.1:52434;
7
server 10.1.10.2:52000;
8
server 10.1.10.2:52001;
9
}
10
11
server {
12
listen 80;
13
14
location /myapp/ {
15
# Location of the Wisej server.
16
proxy_pass http://myapp1;
17
}
18
}
19
}
Copied!
HTTP Load Balancing
nginx
NGING Load Balancing Setup
Note that in the sample above we used "ip_hash" to bind a specific server to a client in order to achieve the required sicky session functionality. NGINX also supports "sticky" and other options.
Last modified 2mo ago
Export as PDF
Copy link