Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Run sudo mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.bak to create a default copy of the default configuration.

  2. Run sudo vim Create a file /etc/nginx/conf.d/phixflow.conf (e.g. with sudo nano /etc/nginx/conf.d/phixflow.conf) and paste in the following, replacing [subdomain] with the appropriate subdomain of the server:

    Code Block
    server {
        listen 443 ssl;
        listen [::]:443 ssl ipv6only=on;
    
        server_name [subdomain].phixflow.com;
    
        proxy_intercept_errors on;
        error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 421 422 423 424 425 426 428 429 431 451 500 501 502 503 504 505 506 507 508 510 511 /custom_error.html;
        location = /custom_error.html {
            internal;
            root /usr/share/nginx/html;
        }
    
        location / {
            proxy_pass http://127.0.0.1:8080;
        }
    
        ssl_certificate /etc/letsencrypt/live/[subdomain].phixflow.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/[subdomain].phixflow.com/privkey.pem;
        include /etc/letsencrypt/options-ssl-nginx.conf;
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
        client_max_body_size 40M;
        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
    }
  3. Create a custom error page

  4. Create a file /usr/share/nginx/html/custom_error.html , (e.g. with sudo nano /usr/share/nginx/html/custom_error.html, ) and enter the following contents:

    Code Block
    languagehtml
    <!doctype html>
    <html>
        <head>
            <meta charset="UTF-8" />
            <meta name="viewport" content="width=device-width, initial-scale=1.0" />
            <meta http-equiv="X-UA-Compatible" content="IE=11" />
            <title>PhixFlow Error</title>
        </head>
        <body>
            <div class="access-error" style="font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 24px; text-align: center; position:absolute; top:300px; width:100%; ">
                An unexpected error has occurred opening PhixFlow, please contact the support desk.
            </div>
        </body>
    </html>
  5. Restart NGINX:

    Code Block
    sudo nginx -s reload
    sudo service nginx stop
    sudo service nginx start

    You may need to reboot the server as well in order for NGINX to restart successfully.

  6. Run netstat -tln to check the server is listening on port 443 rather than 80.

  7. Check the PhixFlow application loads in the browser. Check the security settings in the browser console.

  8. Run nginx -V to check the version.

...

Code Block
sudo service nginx restart

Anchor
nginxMultipleServerMultiplePhixFlow
nginxMultipleServerMultiplePhixFlow
Multiple

...

PhixFlow webapps or multiple servers

A single reverse proxy can handle connections to different webapps (i.e. installations of PhixFlow), whether these are hosted on a single server, or across several servers. See *** for common network configuration for PhixFlow installation. However, whichever configruation you choose, the configuration is the same: you need an IP address and a webapp name to define each PhixFlow installation.

...