Author Topic: HFS behind Nginx reverse proxy  (Read 1751 times)

0 Members and 1 Guest are viewing this topic.

Offline finchy70

  • Occasional poster
  • *
  • Posts: 6
    • View Profile
HFS behind Nginx reverse proxy
« 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.

Offline bmartino1

  • Tireless poster
  • ****
  • Posts: 880
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
Re: HFS behind Nginx reverse proxy
« Reply #1 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
I'm only trying to help i mean no offense.
thank you for your time and patience,
Bmartino1

Offline finchy70

  • Occasional poster
  • *
  • Posts: 6
    • View Profile
Re: HFS behind Nginx reverse proxy
« Reply #2 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.



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?




Offline finchy70

  • Occasional poster
  • *
  • Posts: 6
    • View Profile
Re: HFS behind Nginx reverse proxy
« Reply #3 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.

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12953
    • View Profile
Re: HFS behind Nginx reverse proxy
« Reply #4 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.

Offline stanleydoss2018

  • Occasional poster
  • *
  • Posts: 1
    • View Profile
Re: HFS behind Nginx reverse proxy
« Reply #5 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.

Offline Warnercag

  • Occasional poster
  • *
  • Posts: 4
    • View Profile
HFS behind Nginx reverse proxy
« Reply #6 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

Offline nicksnake

  • Occasional poster
  • *
  • Posts: 2
    • View Profile
Re: HFS behind Nginx reverse proxy
« Reply #7 on: March 02, 2019, 01:59:58 AM »
I build HFS 2.4rc2  behind NGINX, it is ok, but cannot get the real ip, 

Offline nicksnake

  • Occasional poster
  • *
  • Posts: 2
    • View Profile
Re: HFS behind Nginx reverse proxy
« Reply #8 on: March 02, 2019, 07:11:26 AM »

Offline bmartino1

  • Tireless poster
  • ****
  • Posts: 880
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
Re: HFS behind Nginx reverse proxy
« Reply #9 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
I'm only trying to help i mean no offense.
thank you for your time and patience,
Bmartino1

Offline Crowley

  • Occasional poster
  • *
  • Posts: 2
    • View Profile
Re: HFS behind Nginx reverse proxy
« Reply #10 on: November 29, 2019, 12:28:49 PM »
Hello I really like this software but I'm having these problem too, if someone has a working nginx reverse proxy config, please share, my ability with nginx config is limited.

It works somewhat, like said here css is broken and I can only browse forward, going up a folder causes 404. I tried moving hsf file to nginx folder but It did not help.

Browsing in to folders, the link show as "http:localhost:8000/hfs/FOLDER/FOLDER2" but when trying to go up it shows  http:localhost:8000/FOLDER/ the /hsf/ gets lost.

I don't really care about the css if I could just get the browsing working. Any help would be appreciated.

Offline Crowley

  • Occasional poster
  • *
  • Posts: 2
    • View Profile
Re: HFS behind Nginx reverse proxy
« Reply #11 on: December 01, 2019, 06:59:27 PM »
Support no longer needed, I got nginx to act as a file server by itself.