Jail does not get assigned a port

Yannick

Cadet
Joined
Oct 29, 2021
Messages
8
Hi,

I'm running a jail with nextcloud in it. As you can see in the settings below, it's supposed to use NAT. But under 'Admin Portals' in the web GUI, (only) the ip-address of the TrueNAS web GUI is listed.
Isn't there supposed to be some port automatically assigned? How can define at which port the jail can be reached?
Enabling 'NAT Port Forwarding' under 'Network Properties' smells right, but I wasn't able to figure out what to set the values to in order to get it to work.

I'll be happy to provide any information that I didn't think of for this post!

Best,
Yannick

1636129733901.png

1636129760933.png

1636129786137.png

1636129818177.png
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Nextcloud can be quie picky about the "base URL" you use to reach it. Is there a particular reason why you are not using vnet and a separate IP address for the jail?
 

Yannick

Cadet
Joined
Oct 29, 2021
Messages
8
Nextcloud can be quie picky about the "base URL" you use to reach it. Is there a particular reason why you are not using vnet and a separate IP address for the jail?
No, there's not. But I suppose I'll see if can figure that out, then ...
Is there anything in particular you can point me to for instructions? Or else I'll just see what I can find.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Enable VNET, configure IP address, and default gateway for your jail. The nameserver configuration will by default be copied from the NAS host but you can specify your own for the jail if you prefer.

Documentation on creating/configuring a jail can be found here:
 

Yannick

Cadet
Joined
Oct 29, 2021
Messages
8
Enable VNET, configure IP address, and default gateway for your jail. The nameserver configuration will by default be copied from the NAS host but you can specify your own for the jail if you prefer.

Documentation on creating/configuring a jail can be found here:
Thanks a lot! That has worked so far. I can now access nextcloud via its ip address when I'm on the local network.
The only thing remaining now is to point the nginx reverse proxy that I have running to the correct port. Do you know where / how I can find out which port I need to forward to?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
If you can access it by entering the IP address in your browser, then ... 80?
 

Yannick

Cadet
Joined
Oct 29, 2021
Messages
8
When I try that, Firefox says "Firefox has detected that the server is redirecting the request for this address in a way that will never complete."
443, rightfully, complains that an HTTP request is forwarded to an HTTPS port.
Is there any test I can do or a type of file I can look for to find the port? Or do you have any more educated guesses;)?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776

Yannick

Cadet
Joined
Oct 29, 2021
Messages
8
What's the complete URL when you use Nextcloud with the IP address in your browser? And does your reverse proxy use HTTP or HTTPS?

Did you follow the official documentation for setting up the reverse proxy?
The full address when I'm logged in (to nextcloud) is https://192.168.0.112/apps/dashboard/#/.
The reverse proxy is supposed to handle the certificates for https. So if I'm not mistaken, it gets a HTTPS request and forwards that to nextcloud using HTTP.
I did use the docs you linked.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Yes, but obviously Nextcloud is already using HTTPS. And probably a redirect from HTTP to HTTPS when you are coming through the reverse proxy. So I'd try HTTPS --> HTTPS first, just change the config of your frontmost nginx. Probably you need to tell it not to care about the certificate - I don't have that ready from the top of my head, but it should be easy to look up.

Alternative: tell Nextcloud to use HTTP and just assume HTTPS is used. Again, I did not memorize how to but it should be easy to find.
 

vidx

Dabbler
Joined
Oct 16, 2021
Messages
40
In your reverseproxy jail, the location for proxy_pass in the HTTPS section of /usr/local/etc/nginx/nginx.conf should be your local nextcloud ip

Code:
    # HTTPS server
    #
     server {
        listen       443 ssl;
        server_name  localhost;

        # SSL information here
        

     location / {
    #  root   html;
    #  index  index.html index.htm;
        proxy_pass https://192.168.0.112; #<-- Nextcloud Local IP



You might want to consider redirecting http to https for listen 80;
 
Top