Skip to content

Changing localhost to your TLD domain for use with nginx reverse proxy #846

@jiveman

Description

@jiveman

I setup the latest nextcloud with docker-compose like the example shows. I also have nginx setup systemwide (not via docker) w/https via letsencrypt. I setup an A-record cloud.foo.com and setup the corresponding reverse proxy via nginx to point to localhost:8080.

This all seems to work fine for accessing via web, however the nextcloud instance still thinks it's domain / server name is 'localhost'. This is apparent by going to settings > Mobile & desktop where you see "server address: http://localhost:8080/". This also breaks functionality of all apps as when setup the server address as https://cloud.foo.com it loads a page asking to log in first or use an app token, both of which subsequently redirect to localhost:8080 which obviously are unreachable.

I am transitioning away from owncloud, and there they had a setting (OWNCLOUD_DOMAIN=cloud.foo.com) you added to your .env file that told OC what domain is should say it is. From what I've gathered I believe you can manually edit the config.php to set an "overwritehost" setting, though I'm not too sure how to do that with docker-compose. Any help would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions