Contact us Login LIVE DEMO FREE TRIAL

Nginx setup and settings

Installing of Nginx

In GNU/Linux debian you can install web server Nginx executing the following command:

$ apt-get install nginx

Creating virtual hosts in Nginx

Domains will be used for applications:

  • ui.domain.com – user interface for online monitoring
  • api.domain.com – HTTP API
  • panel.domain.com – control panel

All web components will be installed in /var/www/, and logs are being written in /var/log/nginx/. The port for API is 8084.

    1. For an API host you need to add file /etc/nginx/sites-available/api.domain.com manually with these settings:
      server {
          listen 80; ## listen for ipv4
          server_name api.domain.com;
          access_log /var/log/nginx/api.domain.com.access.log;

      location / {
          proxy_pass http://localhost:8084/;
          }
      }
    1. For virtual hosts ui.domain.com, panel.domain.com  (server_name, the path to root and the file with logs needs to be the actual one) add file /etc/nginx/sites-available/ui.domain.com and /etc/nginx/sites-available/panel.domain.com:
  server {
      listen 80; ## listen for ipv4
      server_name ui.domain.com;

      access_log /var/log/nginx/ui.domain.com.access.log;

  location / {
      index index.html;
      add_header Access-Control-Allow-Origin *;
      root /var/www/ui.domain.com/;
      }
  }
  1. Create symlinks to enable these sites:
    $ cd /etc/nginx/sites-enabled/
    $ sudo ln -s ../sites-available/ui.domain.com
    $ sudo ln -s ../sites-available/panel.domain.com
    $ sudo ln -s ../sites-available/api.domain.com
    
  2. Make sure that nginx can load files up to 10 Mb, by default this size is 1 Mb. This size can be changed by adding a line into the main config of Nginx:
    client_max_body_size 20m;
  3. Reload Nginx configuration:
    $ sudo nginx -s reload
  4. Now you can check application at the address: http://ui.domain.com/ and control panel at http://panel.domain.com

How to install Nginx under Windows

Official web site recommends to use project winginx
Just follow steps to make EXE package. After that you should move package to windows server. Make double-click to install. Now Nginx can run and stop using Windows services.

If you have more questions please contact our support team

Contacts

USA: +1 858 815 9045

Mexico: +52 334 1642158

UK: +44 808 1641499

Germany: +49 1573 5988250

Russia: +7 495 223 0427

Log in

Login

[clean-login]

CLOSE
Register

[clean-login-register]

CLOSE
Loading...