Redirect to a other computer in my local network with Nextcloud

Discussion in 'General' started by Rodrigues, Jan 6, 2023.

  1. Rodrigues

    Rodrigues New Member

    Hi,
    I create a virtual machine with Ubuntu Server 22.04 and installed Ispconfig 3. The Ispconfig working very well, but I need that the subdomain goes to another computer with Nextcloud.

    example.com ----> ispconfig server Ok
    example.com record A to my Home server. OK
    nextcloud.example.com ----> redirect to my other VM with Nextcloud (local ip 192.168.15.20) snap installed. Fail

    VM ISPConfig local ip 192.168.15.10
    VM Nextcloud local ip 192.168.15.8

    My router and my ports 80,443 and other working very well.

    I try to use the redirects but fail, working only on my local network.

    upload_2023-1-5_21-56-18.png
     
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Have you tried using proxy?
     
  3. Rodrigues

    Rodrigues New Member

    But How I use it in this project? Another machine before the Ubuntu server ( physical machine) with a proxy server as NGINX?
     
  4. Rodrigues

    Rodrigues New Member

    Can't I only redirect to my local IP? nextcloud.example.com ----> ISPConfig DNS ----> VM Nextcloud 192.168.15.20:80
    If I change the port forward to VM Nextcloud, the Nextcloud website work, but I can't use ISPConfig =[
     
  5. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Could be (as I am not really clear / comprehend on how you really setup yours). That said, what I was thinking earlier is if your main proxy server is your ISPConfig server, the proxy should be created from there. Otherwise, if it was earlier on, i.e. on your physical ubuntu server, then the proxy should be created from there.
     
  6. Rodrigues

    Rodrigues New Member

    If I install o NGINX proxy reverse, the others websites continue working? example2.com it to go to iISPConfig (VM Machine other ip)?
    or
    Will I have to create it manually for others websites?
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Direct all traffic to the ISPConfig server, create a website in ISPConfig for the domain you want to use for nextcloud and then select a proxy redirect in the settings of that site and point that to the IP of your internal nextcloud server.
     
  8. Rodrigues

    Rodrigues New Member

    upload_2023-1-6_5-12-17.png

    Hi
    Work only in my local network. Out don't work,
     
  9. Rodrigues

    Rodrigues New Member

    Need I create a hostname in the Nextcloud server?
    /etc/hosts
    ex: 127.0.0.1 nextcloud.example.com
    My ISPConfig is with apache.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    According to your diagram, the nextcloud machine is in your local network. For the web server, it makes no difference where the target of the proxy requests is as long as it is reachable by http.
     
  11. Rodrigues

    Rodrigues New Member

    \o/
    The main domain (example.com) worked! Wow, but subdomains (nextcloud.example.com) don't work. Does the proxy redirect with subdomains work too?
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    How did you add nextcloud.example.com in ISPConfig? as a subdomain or as a separate website? I would recommend creating a new website nextcloud.example.com and there you set the proxy redirect.
     
  13. Rodrigues

    Rodrigues New Member

    Subdomains working now. I activated the SSL ( I don't know, only SSL activated that did work), but I have another problem with the virtual machines. ISPConfig doesn't ping with Nextcloud virtual machine, only with the physical host.
    But the domain and subdomain are with proxy redirect working. Redirected the ISPConfig ( Virtual Machine) to a physical machine that does ping.
    I'll now try to fix the ping in between virtual machines.

    Thank you very much !!! \o/
     
    ahrasis likes this.
  14. Rodrigues

    Rodrigues New Member

    Feedback.
    All working now !!! I do a bridge network with my Mellanox networking and all virtual machines ping to other virtual machines and to host too. ( Bridge and interface with the same MTU: 9000) If a different MTU a very slow in my networking > 1MB. With the same MTU 1GB/s )
    But the redirect with proxy working to my local networking with machine physical and with simple app executing. The test used Apache in port 80 in local networking and with redirect proxy, worked very well, but with my virtual machine and Nextcloud installed with Snap, don't work.
    But putting this code in the ISPConfig Menu --> options ---> Apache Directives
    -------------------------------------------------------------
    ProxyPreserveHost On
    ProxyPass / http://192.168.15.20/
    ProxyPassReverse / http://192.168.15.20/
    <Location />
    Order deny,allow
    Allow from all
    </Location>
    -------------------------------------------------------------
    Thanks very much !!!
     
    ahrasis and till like this.
  15. Rodrigues

    Rodrigues New Member

    Putting the code before, worked very well in local and outside networking.
     

Share This Page