rejetto forum

HFS behind Nginx reverse proxy

0 Members and 1 Guest are viewing this topic.

Offline finchy70

  • Occasional poster
  • *
    • Posts: 6
    • View Profile
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: 910
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
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
Files I have snagged and share can be found on my google drive:

https://drive.google.com/drive/folders/1qb4INX2pzsjmMT06YEIQk9Nv5jMu33tC?usp=sharing


Offline finchy70

  • Occasional poster
  • *
    • Posts: 6
    • View Profile
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
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: 13510
    • View Profile
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
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
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
I build HFS 2.4rc2  behind NGINX, it is ok, but cannot get the real ip, 



Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 910
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
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
Files I have snagged and share can be found on my google drive:

https://drive.google.com/drive/folders/1qb4INX2pzsjmMT06YEIQk9Nv5jMu33tC?usp=sharing


Offline Crowley

  • Occasional poster
  • *
    • Posts: 2
    • View Profile
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
Support no longer needed, I got nginx to act as a file server by itself.