person Posted August 3, 2017 Share Posted August 3, 2017 Hi. I am new to unraid. I was wondering if there is a way to make it so that when I type in http and the ip address for unraid it forwards it to https and the ip address where nextcloud is. I want it so that if the ip of unraid is 192.168.1.10, when I type http://192.168.1.10 then the page automatically goes to https://192.168.1.10 I was trying to use port 80 with nextcloud, so I went into the "go" file in /flash/config/ in unraid and changed it so that the unraid webUI is using port 8000. Then I added port 80 to the docker container. Every time I try to reach the docker by going to "http://192.168.1.10" it forwards me to "https://_" I have tried this with different apps, such as couchpotato and nextcloud, and have gotten the same result. Is it possible to change it so that when I type "http://192.168.1.10" it goes to "https://192.168.1.10" Or have it so that when I type in "http://192.168.1.10" it goes to the docker's web UI. Any help is appreciated. Quote Link to comment
jonp Posted August 15, 2017 Share Posted August 15, 2017 Hi, Please post your system diagnostics. These can be collected from the Tools > Diagnostics page inside the unRAID webGui. In addition, if you could share your port mapping settings for the container(s) you've tried, that would be ideal. It sounds like you have a container configured incorrectly with respect to port forwarding. Quote Link to comment
jonp Posted August 15, 2017 Share Posted August 15, 2017 Also, try stopping Docker completely (Settings -> Docker) and see if the forwarding works properly in that state. Quote Link to comment
CHBMB Posted August 15, 2017 Share Posted August 15, 2017 Not enough information to really say what's going on with Nextcloud, but if port 80 is mapped nginx in our Nextcloud container is setup to forward http to https. https://github.com/linuxserver/docker-nextcloud/blob/master/root/defaults/default#L10 Quote Link to comment
jonp Posted August 15, 2017 Share Posted August 15, 2017 CHBMB do you have any systems configured to service a container on port 80/443 as opposed to the unRAID UI itself? Curious if anyone else has been able to recreate his issue. Quote Link to comment
CHBMB Posted August 15, 2017 Share Posted August 15, 2017 No, but I could probably try, although I don't anticipate any issues.I'll get back to you@jonpSent from my LG-H815 using Tapatalk Quote Link to comment
person Posted August 17, 2017 Author Share Posted August 17, 2017 Sorry for the delay. I have linked my diagnostics and photos of my dockers for Nextcloud and Couchpotato. When I disable the docker in settings and type in http://192.168.1.10 then the browser says no DNS address was found. But when the docker is enable then it takes me to https://_ when nextcloud is stopped and couchpotato is running or vice versa. When both are stopped then it states no DNS address was found. diagnostics-20170817-1438.zip Quote Link to comment
CHBMB Posted August 17, 2017 Share Posted August 17, 2017 You can't run both containers at the same time as you can't have two webservers running on port 80 If you go to http://...... when neither container is running then you will get an error as there is no webserver running to respond to a request on http which is on port 80 Neither of the containers are running on the ip you're typing in which is http://192.168.1.10 The ip is http://192.168.1.211 I'm not intending to be rude here, so please don't take it so, but have you any experience with web/network setup, at the moment all I can see is a lot of poor configuration. I have no idea why you want to run couchpotato on port 80 or Nextcloud on port 80 for that matter. Quote Link to comment
person Posted August 17, 2017 Author Share Posted August 17, 2017 I have very little experience with network setups. I do type in http://192.168.1.211 to try and access nextcloud. I was just using http://192.168.1.10 as an example. I just want it where when I type http://192.168.1.211 it forwards me to https://192.168.1.211. I thought that if I used port 80 for nextcloud then nextcloud would forward me to port 443. But I was probably mistaken. This is how I had it configured on freenas where when I type http://192.168.1.2 it forwards me to https://192.168.1.2 where nextcloud was. When I run nextcloud I stop all of the other containers. Originally port 80 was only on nextcloud, so when I tried accessing nextcloud from http://192.168.1.211 it took me to https://_. Then I wanted to try a different docker so I downloaded couchpotato and turned off nextcloud and used port 80 in couchpotato to get the same result where it took me to https://_. So I assumed that since the same thing was happening in a different app then it had to do with something in unraid rather than nextcloud. Quote Link to comment
CHBMB Posted August 17, 2017 Share Posted August 17, 2017 (edited) Did you configure and setup nextcloud before starting this configuration? The couchpotato webserver runs on 5050, so port 80 will never work for that. Edited August 17, 2017 by CHBMB Quote Link to comment
person Posted August 17, 2017 Author Share Posted August 17, 2017 I originally setup and configured nextcloud on port 443 and it runs on port 443. Quote Link to comment
CHBMB Posted August 17, 2017 Share Posted August 17, 2017 So got to ask why you want to use port 80 to redirect to 443. Quote Link to comment
person Posted August 17, 2017 Author Share Posted August 17, 2017 My family are going to be using the nas, so I want them to simply type 192.168.1.211 and it takes them to https://192.168.1.211 where nextcloud provides an easy to use interface. Quote Link to comment
CHBMB Posted August 17, 2017 Share Posted August 17, 2017 Any plans to access it from outside your LAN? Quote Link to comment
person Posted August 17, 2017 Author Share Posted August 17, 2017 I was planning on getting a domain. So I want the same thing where when they type example.com it takes them directly to https://example.com. Quote Link to comment
CHBMB Posted August 17, 2017 Share Posted August 17, 2017 Get your domain sorted then follow the guide I wrote here. Quote Link to comment
person Posted August 17, 2017 Author Share Posted August 17, 2017 I have a domain. When I type example.com it goes to http://example.com and looks for port 80 within my router. So I was trying to get port 80 to go to nextcloud or have it where it is automatically redirected to https://example.com. When I type https://example.com it works and takes me to nextcloud. Quote Link to comment
CHBMB Posted August 17, 2017 Share Posted August 17, 2017 Follow the guide, and turn off remote access to your router which is what I suspect it happening. Some ISPs don't allow inbound connections on port 80 and there's no way around that Quote Link to comment
person Posted August 18, 2017 Author Share Posted August 18, 2017 I got an ssl certificate from godaddy and I put the certificates in the keys folder in nextcloud. Then in /nextcloud/ngix/default I replaced the line "ssl_certificate /config/keys/cert.crt;" with "ssl_certificate /config/keys/nameofcertificate.crt;" and I replaced "ssl_certificate_key /config/keys/cert.key;" with "ssl_certificate_key /config/keys/nameofkey.key;". I did not touch any other file or line and restarted nextcloud, but now my domain and ip address wont connect to nextcloud. Was there something else I was supposed to do? Quote Link to comment
CHBMB Posted August 18, 2017 Share Posted August 18, 2017 2 minutes ago, person said: I got an ssl certificate from godaddy and I put the certificates in the keys folder in nextcloud. Then in /nextcloud/ngix/default I replaced the line "ssl_certificate /config/keys/cert.crt;" with "ssl_certificate /config/keys/nameofcertificate.crt;" and I replaced "ssl_certificate_key /config/keys/cert.key;" with "ssl_certificate_key /config/keys/nameofkey.key;". I did not touch any other file or line and restarted nextcloud, but now my domain and ip address wont connect to nextcloud. Was there something else I was supposed to do? In all honesty, you're making all of this a lot more complicated than it needs to be. Follow the guide I wrote and it will sort out your certificates and do everything you're after. Setting up a webserver from scratch combined with trying to modify the config of a container that we recommend you run behind the LetsEncrypt container for good reason. Quote Link to comment
Jessie Posted August 27, 2017 Share Posted August 27, 2017 On 19/08/2017 at 5:52 AM, person said: I got an ssl certificate from godaddy and I put the certificates in the keys folder in nextcloud. Then in /nextcloud/ngix/default I replaced the line "ssl_certificate /config/keys/cert.crt;" with "ssl_certificate /config/keys/nameofcertificate.crt;" and I replaced "ssl_certificate_key /config/keys/cert.key;" with "ssl_certificate_key /config/keys/nameofkey.key;". I did not touch any other file or line and restarted nextcloud, but now my domain and ip address wont connect to nextcloud. Was there something else I was supposed to do? I've been on a steep learning curve with dockers. Thanks to CHBMB's guides and his dockers, (of which I am eternally gratefull) I am starting to get a good understanding of how this all works. Can I suggest you look at the nextcloud. mariadb and the letsencrypt dockers as a learning exercise. CHBMB has a really good guide to marry them together. Letsencrypt will get you free self renewing certificates as well as being a reverse proxy. It will direct the domain eg "cloud.domain.com" to the nextcloud server. Letsencrypt uses port 443. Unfortunately so does MS Small business server. To make them live together turned out to be simple. I pointed port 443 to the unraid server and added a file to the site-confs directory (the nextcloud file is in this directory as well) in letsencrypt which points to the SBS servers ip address on port 443. I also added "remote," to the letsencrypt docker so the certificate recognised cloud.domain.com and remote.domain.com Worked first go. You can add other servers to the lets encrypt docker in a similar manner by creating the txt file in CHBMB's guide and adjusting the pointers to the program. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.