rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: finchy70 on September 15, 2018, 07:55:49 PM

Title: HFS behind Nginx reverse proxy
Post by: finchy70 on September 15, 2018, 07:55:49 PM
Hi. 
I have managed to set up HFS behind a reverse proxy.but HFS seems to lose its css.  How do I set the  /domain in HFS options as I think this may be the problem.
Title: Re: HFS behind Nginx reverse proxy
Post by: bmartino1 on September 15, 2018, 10:10:24 PM
Did you bind hfs to a real folder.

I would first set a bind and then eidte or reuse the default template at the root in that folder(hfs.diff.tpl) before the proxy to verify file cashed and load.

Otherwise you will have to settle up IP hfs connect is on
Title: Re: HFS behind Nginx reverse proxy
Post by: finchy70 on September 16, 2018, 07:43:21 AM
Thanks for the reply.
Could you explain what you mean in a little more detail please.

Here is my HFS folder with tpl file.
(https://i.imgur.com/mTd6PH0.png)


Here is my config for HFS in Nginx.

location /hfs {
   proxy_pass http://127.0.0.1:4443/;
   proxy_set_header  X-Real-IP  $remote_addr;
   proxy_set_header        Host              $host;
   proxy_set_header        X-Forwarded-For   $proxy_add_x_forwarded_for;
   proxy_set_header        X-Forwarded-Proto $scheme;
   proxy_redirect off;
   proxy_buffering off;
}

Also how do I append /hfs to the address in the HFS settings?



Title: Re: HFS behind Nginx reverse proxy
Post by: finchy70 on September 17, 2018, 11:08:47 AM
Solved the issue by moving HFS to the root of Nginx proxy server.  Would like to know how to move it to the /hfs url though.
Title: Re: HFS behind Nginx reverse proxy
Post by: rejetto on September 17, 2018, 10:09:00 PM
i guess you should rewrite the url, removing the /hfs when the request is passed to hfs.
google for it. in Apache rewrite is possible.

worst case you can move all your stuff in the hfs' virtual file system under a folder /hfs.
Title: Re: HFS behind Nginx reverse proxy
Post by: stanleydoss2018 on December 13, 2018, 09:03:22 AM
i guess you should rewrite the url, removing the /hfs when the request is passed to hfs.
google for it. in Apache rewrite is possible.

worst case you can move all your stuff in the hfs' virtual file system under a folder /hfs.

Yes, Apache rewrite: httpd.apache.org/docs/current/rewrite/ would be probably the easiest solution here.
Title: HFS behind Nginx reverse proxy
Post by: Warnercag on January 14, 2019, 05:26:57 PM
It would be great if the web interface can be compatible with reverse proxy.
- using only relative path /browse/0 -> browse/0
- or, appending a configurable root point ums to have /ums/browse/0
Title: Re: HFS behind Nginx reverse proxy
Post by: nicksnake on March 02, 2019, 01:59:58 AM
I build HFS 2.4rc2  behind NGINX, it is ok, but cannot get the real ip, 
Title: Re: HFS behind Nginx reverse proxy
Post by: nicksnake on March 02, 2019, 07:11:26 AM
follow the link http://rejetto.com/forum/index.php?topic=11379.0,fix it。
Title: Re: HFS behind Nginx reverse proxy
Post by: bmartino1 on March 08, 2019, 01:23:02 PM
follow the link http://rejetto.com/forum/index.php?topic=11379.0,fix it。

??? Nothing to fix it all in nginx setup and how you edit hfs in on top of internal hfs setting and path location...

Quote from rejeto:

it's possible, but disabled for security reasons.

You have to edit the INI file
as reported here
http://www.rejetto.com/forum/hfs-~-http-file-server/requestshow-ip-address-by-using-forwarded-ip/msg1037912/#msg1037912


save configuration to INI
quit HFS
edit INI
change the value
save
run hfs