====== Reverse proxying for a QNap server ====== QNap is a pretty good investment for your data. The only pain I have had with it is the web UI that is partially hard-coded which makes reverse proxying a nightmare. Here is the config that worked for me.: * QNap Server: 10.1.1.100 * NASC123B8 = Self assigned hostname of QNap * Webserver on port 8080 * 2nd Webserver on port 8081 for BackupPC ServerName qnas.domain.tld SSLEngine on SSLProtocol all -SSLv2 SSLCertificateFile /etc/ssl/cert.pem SSLCertificateKeyFile /etc/ssl/key.key RewriteEngine on RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) RewriteRule .* - [F] DocumentRoot /var/www Options FollowSymLinks AllowOverride AuthConfig SetOutputFilter INFLATE;proxy-html;DEFLATE ProxyHTMLExtended On ProxyHTMLDoctype XHTML ProxyPass http://10.1.0.100:8081/ ProxyPassReverse http://10.1.0.100:8081/ ProxyHTMLURLMap / /bu/ ProxyHTMLURLMap 10.1.0.100:8081 qnap.domain.tld ProxyHTMLURLMap NASC123B8 qnap.domain.tld Substitute "s|/bu//bu/|//|in" authtype basic authname "Server External" authuserfile /some/safe/directory/.htpasswd require valid-user SetOutputFilter INFLATE;proxy-html;DEFLATE ProxyHTMLExtended on ProxyHTMLDoctype XHTML ProxyPass http://10.1.0.100:8080/ ProxyPassReverse http://10.1.0.100:8080/ AddOutputFilterByType SUBSTITUTE text/html AddOutputFilterByType SUBSTITUTE text/xml Substitute "s|8080|443|in" Substitute "s|http://|https://|in" ServerName qnas.domain.tld RewriteEngine on RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) RewriteRule .* - [F] RewriteCond %{REQUEST_URI} !^/nrd/ RewriteCond %{REQUEST_URI} !^/images/ RewriteCond %{REQUEST_URI} !^/css/ RewriteCond %{REQUEST_URI} !^/javascript/ RewriteCond %{REQUEST_URI} !^/vncterm/ RewriteCond %{REQUEST_URI} !^/.*\.js$ RewriteCond %{REQUEST_URI} !^/login.pl$ RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [L,R]