Open basheuvelink opened 5 years ago
Hello @basheuvelink. Yes, it is possible. At first, you should change proxy configuration and then set virtual path to special nextcloud option - overwritewebroot.
part of nginx settings:
location /nextcloud/ {
proxy_pass_header Server;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://nextcloud/;
}
nextcloud config.php
<?php
$CONFIG = array (
<..some configs..>,
'overwritewebroot' => 'nextcloud'
);
See documentation
Hero! Many thanks in advance! I'm a little bit noobish - just started with ubuntu -
Since nextcloud is running in docker, I can access the container files using docker-compose exec. Any ideas how to edit the config.php?
docker exec -it nextcloud_container_id bash
apt update && apt install -y nano
nano config/config.php
I'm getting there.. Modified the config.php succesfully. Also added location to nginx.conf. Now when opening the 'new' Url i get 502 Bad Gateway nginx/1.15.8. I guess the proxy_pass value isn't correct. I refer here to the app-server running in docker. How do I find the good reference for the nextcloud server?
Can you show nginx settings and config.php settings?
Here the config.php config.php.txt
Here the nginx.conf nginx.conf.txt
I see, you added my example part of nginx settings, but you don't changed path to nextcloud. Please, change http://nextcloud/ to your real nextcloud path (I think, it is home.mynetgear.com)
You use docker compose from https://github.com/ONLYOFFICE/docker-onlyoffice-nextcloud?
Yes, exactly that one.
Let me clarify my problem, from an end-user perspective: I want nextcloud available at my URL: home.mynetgear.com/nextcloud I don't want it available at home.mynetgear.com
So in your solution I think I only need to now the exact server name, internally, to refer to the nextcloud service.
Okay I've been trying some things, no luck still. Funny thing though I've managed it untill so far: when I open the URL for my host http://home.mynetgear/nextcloud it redirects it to the correct pages, adding /index.php/apps/files/ in the process, but then the page remains blank. I've added the config.php and nginx.conf for this configuration.
Also I tried to change the install directory in the docker-compose.yml file, changing the directory of the nextcloud volume with extension /nextcloud (so app_data:/var/www/html/nextcloud). This seems to break it down even more, also with the added location values in config.php.
Hope you have some more thoughts! Thanks anyway
@basheuvelink, I tried to find an easy way for making proxy via nginx.conf from this repo, but it is not possible. I think, nextcloud proxy setting is a question for nextcloud community. Maybe, you can find answear there. If you want to change nextcloud root path, you need to rewrite all nginx config. See this
That's too bad! Thanks for the documentation. Can't believe it's that difficult in nginx compared to apache2.
I managed to pull it off eventually! Basically had to move the files from the /var/www/html dir to a subdir and implemented parts of the code as suggested in your last post to the nginx.conf.
@basheuvelink, yes, I tried to do it too, but I have some errors after it. Can you show your result nginx config?
@flaminestone , these are my configs:
Is it possible to customize nginx.conf in a matter so you could open nextcloud at a custom location? For example: http://localhost/nextcloud instead of http://localhost
Thanks!