Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

8
Nextcloud-Docker (nginx): redirect http to https on port 4444 not working
Author Summary
jesta030 is age 44
Post Body

I have an UnRAID machine that is running Nextcloud with ports mapped (host->container) 8181->80 and 4444->443.

To access it remotely I have a domain pointing to a VPS that runs OpenVPN server which the UnRAID machine connects to. The VPS is forwarding public ports 80 and 443 to UnRAID's ports 8181 and 4444 via the OpenVPN tunnel. The http->https redirect is working as intended in this instance.

When accessing Nextcloud via http on it's LAN or OpenVPN IP i get redirected to UnRAID's web interface. The problem is the container's nginx config. It doesn't know that it should redirect traffic from local or VPN IPs to port 4444 instead of 443.

I have changed /nginx/site-confs/default to include a second server directive:

server {
    listen 80;
    listen [::]:80;
    server_name my.domain *.my.domain;
    return 301 https://$host:443$request_uri;
}

server {
    listen 80;
    listen [::]:80;
    server_name (LAN.IP) (VPN.IP;
    return 301 https://$host:4444$request_uri;
}


server {
    listen 443 ssl http2;
    ...

But his doesn't work. When accessing from LAN or VPN via IP I still get sent to port 443 which is UnRAIDs web interface.

Any tips?

Author
Account Strength
100%
Account Age
12 years
Verified Email
Yes
Verified Flair
No
Total Karma
47,033
Link Karma
3,471
Comment Karma
42,875
Profile updated: 3 days ago
Posts updated: 1 day ago

Subreddit

Post Details

Age
44
We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
4 years ago