To run MSUI behind a proxy you need to install a NGINX or Apache, and then configure it to pass the traffic to a local MSUI instance.
Before enabling proxy you should change to proxy mode in /etc/halon/msui.yaml
and restart the service:
server: host: "127.0.0.1" port: 3000 proxy: enabled: true ip: "loopback"
To pass the correct IP address to MSUI you need to forward the X-Forwarded-For header.
https://www.nginx.com/resources/wiki/start/topics/examples/forwarded/ (NGINX)
https://httpd.apache.org/docs/2.4/mod/mod_remoteip.html (Apache)
Example configuration file for NGINX
server { # SSL configuration listen 443 ssl default_server; listen [::]:443 ssl default_server; ssl_certificate cert.pem; ssl_certificate_key cert.key; root /var/www/html; index index.html index.htm index.php; server_name msui.example.com; # web-logui location /web-logui/ { try_files $uri $uri/ =404; } # public files, for images e.g. location /public { try_files $uri $uri/ =404; } # pass PHP scripts to FastCGI server location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; } # MSUI instance location / { proxy_pass http://127.0.0.1:3000; } }
Example configuration file for Apache
<IfModule mod_ssl.c> <VirtualHost *:443> # web-logui ProxyPass /web-logui ! # public files, images e.g. ProxyPass /public ! # MSUI instance ProxyTimeout 60 ProxyPass / "http://127.0.0.1:3000/" connectiontimeout=5 timeout=60 ServerName https://msui.example.com ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SSLEngine on SSLCertificateFile ssl-cert-snakeoil.pem SSLCertificateKeyFile ssl-cert-snakeoil.key <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> </VirtualHost> </IfModule>
Comments
0 comments
Article is closed for comments.