article

Paul Toone avatar image
0 Likes"
Paul Toone posted

FlexSim Web Server Proxied with Nginx

FlexSim's Webserver is a query-driven manager and communication interface for FlexSim. It allows you to run FlexSim models through a web browser like Google Chrome, FireFox, Internet Explorer, etc. Since the FlexSim Web Server is a basic service to allow FlexSim to be served to a browser, you may decide you want a way to proxy to this service through a full service web server that you can control security and authentication through.

This guide will walk you through proxying to the FlexSim Web Server through Nginx web server.


Install the FlexSim Web Server Program

  • Download and install the FlexSim Web Server from https://account.flexsim.com
  • Edit C:\Program Files (x86)\FlexSim Web Server\flexsim webserver configuration.txt
  • Change the port from 80 to 8080
  • Start the FlexSim Web Server by double clicking flexsimserver.bat
  • Test the server by going to http://127.0.01:8080
  • It should look like this:

1693237892815.png


Install Nginx Reverse Proxy

  • From a browser, visit http://nginx.org/en/download.html
  • Download latest stable release for Windows
  • Extract the downloaded nginx-<version>.zip
  • Rename the unzipped nginx-<version> folder to nginx
  • Copy the nginx folder to C:\
  • Double click the C:\nginx\nginx.exe file to launch Nginx
  • Test Nginx by going to http://127.0.0.1
  • It should look like this:

1693237868374.png

Configure Nginx to proxy to the FlexSim Web Server

  • Open C:\nginx\conf\nginx.conf in a text editor
  • Find the section that says:
location / {
    root html;
    index index.html index.htm;
}


  • Edit out the root and index directives and add a proxy_pass directive so it appears like this:
location / {      
    proxy_pass http://127.0.0.1:8080;
    #root html;
    #index index.html index.htm;
}
  • Save the nginx.conf file

Reload Nginx to Apply the Changes

  • Open a command line window by pressing Windows+R to open "Run" box. Type "cmd" and then click "OK"
  • From the command line windows, type the following to change to the nginx directory:

C:\nginx>cd C:\nginx and press enter

  • Now, type the following to reload Nginx:

C:\nginx>nginx -s reload

Test the FlexSim Web Server Being Proxied by Nginx

  • From a browser window again go to http://127.0.0.1
  • You should now see the FlexSim Web Server interface proxied through Nginx


Now that you have the FlexSim Web Server proxied through Nginx, you may decide you want to configure Nginx to handle security, authentication and customization. Since this is out of the scope of this guide, you can find details on the Internet that can guide you to setting these customizations up.

A few resources you may consider:


webserverflexsim webserver
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Article

Contributors

paul.t contributed to this article