FreeNAS Behind Reverse Proxy

Status
Not open for further replies.

brando56894

Wizard
Joined
Feb 15, 2014
Messages
1,537
I'm in the process of setting up all my hosted services on HTPC Manager for easy access. I have a basic understanding of apache reverse proxies since I have successfully configured them for transmission, sickrage, couchpotato and nzbget, I'm having problems though with FreeNAS since it redirects to the login page.

I have virtual hosts configured for each running webserver and have everything set in /usr/local/apache24/extras/httpd-vhosts.conf like so

Code:
<VirtualHost *:80>
  ServerName localhost
  ServerAlias 127.0.0.1
  ProxyPreserveHost on

    <Location /freenas>
        order deny,allow
        deny from all
        allow from all
        ProxyPass http://192.168.1.6
        ProxyPassReverse http://192.168.1.6
    </Location>
</VirtualHost>


when I enter [domain]/freenas into my URL bar it automatically redirects to [domain]/account/login and then says that it can't be found. How can I get it to redirect to freenas instead? Same thing happens with the IPMI interface.
 
Last edited:

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
I don't, but I do know that the FreeNAS WebGUI doesn't use Apache. Does that help?
lol. nope.

the reverse proxy sits on another box (the apache config) and offers a single launchpoint for all internal websites. basically the /freenas appending the IP/domain address would take him to his freenas box, where using /transmission would take him to his transmission box (jail or whatever, just a different ip)

sadly, i cant really help with apache configs because i use nginx on all my servers and my reverse proxies
 

brando56894

Wizard
Joined
Feb 15, 2014
Messages
1,537
lol. nope.

the reverse proxy sits on another box (the apache config) and offers a single launchpoint for all internal websites. basically the /freenas appending the IP/domain address would take him to his freenas box, where using /transmission would take him to his transmission box (jail or whatever, just a different ip)

sadly, i cant really help with apache configs because i use nginx on all my servers and my reverse proxies

How do you have it set up? Maybe it will help me.
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
How do you have it set up? Maybe it will help me.
I don't use a reverse proxy for FreeNAS. I have an html5 VPN that I use to access my network.

I have nginx reverse proxy set up for another couple of servers.
 

brando56894

Wizard
Joined
Feb 15, 2014
Messages
1,537
Ah ok, well I enabled trace logging for the /freenas directory and it seems it is a problem with redirection since I see the error code 302 in the log, even though when I go to my /freenas url it just gives me a white page, no errors or anything. http://www.askapache.com/hosting/reverse-proxy-apache.html specifically mentions this error code and how to fix it, but that doesn't seem to work for me, or maybe I'm not implementing it correctly.

My FreeNAS box is 192.168.1.6 and my Apache server sits on 192.168.1.100

Code:
[Wed May 27 14:06:57.543344 2015] [authz_core:debug] [pid 63450] mod_authz_core.c(835): [client 192.168.1.7:53799] AH01628: authorization result: granted (no directives)
[Wed May 27 14:06:57.543502 2015] [core:trace3] [pid 63450] request.c(238): [client 192.168.1.7:53799] request authorized without authentication by access_checker_ex hook: /freenas
[Wed May 27 14:06:57.543593 2015] [proxy_http:trace1] [pid 63450] mod_proxy_http.c(60): [client 192.168.1.7:53799] HTTP: canonicalising URL //192.168.1.6
[Wed May 27 14:06:57.543638 2015] [proxy:trace2] [pid 63450] proxy_util.c(1953): [client 192.168.1.7:53799] http: found worker http://192.168.1.6 for http://192.168.1.6/
[Wed May 27 14:06:57.543679 2015] [proxy:debug] [pid 63450] mod_proxy.c(1163): [client 192.168.1.7:53799] AH01143: Running scheme http handler (attempt 0)
[Wed May 27 14:06:57.543719 2015] [proxy_http:trace1] [pid 63450] mod_proxy_http.c(1944): [client 192.168.1.7:53799] HTTP: serving URL http://192.168.1.6/
[Wed May 27 14:06:57.543753 2015] [proxy:debug] [pid 63450] proxy_util.c(2193): [client 192.168.1.7:53799] AH00944: connecting http://192.168.1.6/ to 192.168.1.6:80
[Wed May 27 14:06:57.543823 2015] [proxy:debug] [pid 63450] proxy_util.c(2394): [client 192.168.1.7:53799] AH00947: connected / to 192.168.1.6:80
[Wed May 27 14:06:57.556607 2015] [proxy_http:trace3] [pid 63450] mod_proxy_http.c(1424): [client 192.168.1.7:53799] Status from backend: 302
[Wed May 27 14:06:57.556664 2015] [proxy_http:trace4] [pid 63450] mod_proxy_http.c(1099): [client 192.168.1.7:53799] Headers received from backend:
[Wed May 27 14:06:57.556704 2015] [proxy_http:trace4] [pid 63450] mod_proxy_http.c(1101): [client 192.168.1.7:53799] Server: nginx/1.6.2
[Wed May 27 14:06:57.556752 2015] [proxy_http:trace4] [pid 63450] mod_proxy_http.c(1101): [client 192.168.1.7:53799] Date: Wed, 27 May 2015 18:06:57 GMT
[Wed May 27 14:06:57.557056 2015] [proxy_http:trace4] [pid 63450] mod_proxy_http.c(1101): [client 192.168.1.7:53799] Content-Type: text/html; charset=utf-8
[Wed May 27 14:06:57.557096 2015] [proxy_http:trace4] [pid 63450] mod_proxy_http.c(1101): [client 192.168.1.7:53799] Transfer-Encoding: chunked
[Wed May 27 14:06:57.557131 2015] [proxy_http:trace4] [pid 63450] mod_proxy_http.c(1101): [client 192.168.1.7:53799] Connection: keep-alive
[Wed May 27 14:06:57.557174 2015] [proxy_http:trace4] [pid 63450] mod_proxy_http.c(1101): [client 192.168.1.7:53799] Content-Language: en
[Wed May 27 14:06:57.557209 2015] [proxy_http:trace4] [pid 63450] mod_proxy_http.c(1101): [client 192.168.1.7:53799] Location: http://192.168.1.100/account/login/?next=/
[Wed May 27 14:06:57.557245 2015] [proxy_http:trace4] [pid 63450] mod_proxy_http.c(1101): [client 192.168.1.7:53799] Vary: Accept-Language, Cookie
[Wed May 27 14:06:57.557296 2015] [proxy_http:trace3] [pid 63450] mod_proxy_http.c(1687): [client 192.168.1.7:53799] start body send
[Wed May 27 14:06:57.557389 2015] [http:trace3] [pid 63450] http_filters.c(1045): [client 192.168.1.7:53799] Response sent with status 302, headers:
[Wed May 27 14:06:57.557416 2015] [http:trace5] [pid 63450] http_filters.c(1052): [client 192.168.1.7:53799]   Date: Wed, 27 May 2015 18:06:57 GMT
[Wed May 27 14:06:57.557441 2015] [http:trace5] [pid 63450] http_filters.c(1055): [client 192.168.1.7:53799]   Server: nginx/1.6.2
[Wed May 27 14:06:57.558221 2015] [http:trace4] [pid 63450] http_filters.c(874): [client 192.168.1.7:53799]   Content-Type: text/html; charset=utf-8
[Wed May 27 14:06:57.558271 2015] [http:trace4] [pid 63450] http_filters.c(874): [client 192.168.1.7:53799]   Content-Language: en
[Wed May 27 14:06:57.558298 2015] [http:trace4] [pid 63450] http_filters.c(874): [client 192.168.1.7:53799]   Location: http://192.168.1.100/account/login/?next=/
[Wed May 27 14:06:57.558325 2015] [http:trace4] [pid 63450] http_filters.c(874): [client 192.168.1.7:53799]   Vary: Accept-Language,Cookie
[Wed May 27 14:06:57.558359 2015] [http:trace4] [pid 63450] http_filters.c(874): [client 192.168.1.7:53799]   Content-Length: 0
[Wed May 27 14:06:57.558384 2015] [http:trace4] [pid 63450] http_filters.c(874): [client 192.168.1.7:53799]   Keep-Alive: timeout=5, max=100
[Wed May 27 14:06:57.558411 2015] [http:trace4] [pid 63450] http_filters.c(874): [client 192.168.1.7:53799]   Connection: Keep-Alive
[Wed May 27 14:06:57.558467 2015] [proxy_http:trace2] [pid 63450] mod_proxy_http.c(1832): [client 192.168.1.7:53799] end body send
 
Status
Not open for further replies.
Top