I know, HTTPS is important for security. I get that. I want to use a proxy server to apply HTTPS outside of Nextcloud (because I have multiple services on my network which need to respond to requests on 443).
I’ve already configured Nextcloud and the proxy server and everything is working. I’ve added other services and now have problems with Nextcloud. I’m trying to debug and it’s very difficult because when I try to access my Nextcloud directly (without the proxy) by visiting http://nextcloud.internal.ip.address the browser is being redirected to https://nextcloud.internal.ip.address/login. Of course that’s not working because the web server isn’t set to listen to 443. I never setup Nextcloud to force HTTPS, and there’s nothing in config.php which would cause it to.
I’m using nginx for the proxy and the main server, there’s nothing in the main server config to respond to SSL requests and the main proxy is turned off for the time being.
If I configure a different domain to point to nextcloud.internal.ip.address I’m taken to the trusted domain webpage, but when I click to add the domain it redirects my request to the https:// version (which doesn’t respond because the server isn’t setup to listen to 443). I’m guessing things were working before because I had configured the SSL proxy and everything was coming through it so random https redirects didn’t hurt anything.
hello,
from my point of view, this redirection is due to the NGINX configuration files. Did you check the /etc/nginx/conf.d/.conf or /etc/nginx/sites-available/.conf ?
you should find something like that:
server {
listen 80 default_server;
server_name your_domain.fr www.your_domain.fr;
Yep, that’s exactly how my proxy server is configured however like I said the proxy server is turned off and I’m accessing Nextcloud directly. It behaved like this the moment I installed it but I never thought anything of it because it was going to be https proxied anyway.
The nginx conf file for the Nextcloud server has 1 listen directive and it’s listening to 80.
The proxy uses HSTS but the internal IP shouldn’t have an HSTS record. Further if I try to navigate to http://ip.address/login it works, it won’t log in because it insists on redirecting to https to log in, but it doesn’t redirect every request. I suspect something in the code base is causing the redirect for some instructions.
Regardless I did try a new browser, same behavior.