greyltc / docker-owncloud

Arch linux based docker container with owncloud
111 stars 37 forks source link

nginx-proxy #81

Open jujes opened 8 years ago

jujes commented 8 years ago

I need use github.com/jwilder/nginx-proxy with SSL but don't work with any configuration... some one know how??

thanks in advance. here my script:

-- nginx-proxy

docker run -d \
--name proxy \
--restart=always \
-p 80:80 \
-p 443:443 \
-v ~/base/MYCERT:/etc/nginx/certs \
-v /var/run/docker.sock:/tmp/docker.sock:ro \
jwilder/nginx-proxy

-- postgres

docker run \
--name=postgres  \
-e POSTGRES_PASSWORD=PassWord \
-v ~/base/owncloud/db:/var/lib/postgresql/data \
-d postgres

-- l3iggs/owncloud

docker run \
-v ~/base/MYCERT:/root/sslKeys \
--name oc \
-v ~/base/owncloud/data:/usr/share/webapps/owncloud/data \
-v ~/base/owncloud/conf:/usr/share/webapps/owncloud/config \
-p 80 \
-p 443 \
--link=postgres \
-e VIRTUAL_HOST=owncloud.test.dev \
-d l3iggs/owncloud
greyltc commented 8 years ago

I have no experience with this, so I don't think I'll be much help. Here are my (possibly incorrect) thoughts anyway. If the SSL security layer will come from outside my container, you should probably turn it off in l3iggs/owncloud or else you might be double SSLing and that can't be good.

I can't recall ever seeing the VIRTUAL_HOSTvariable used with my container, so I don't know what you're doing there.

If you get this working, please post back on how you did it. It's interesting.

greyltc commented 8 years ago

@jujes any progress on this?

torwag commented 8 years ago

AFAIK the nginx-proxy only work on subdomains. Whereas your owncloud container propose to use an path. The OT tried to use owncloud.test.dev/oc for owncloud. This as I tested by myself does not work with the nginx-proxy which expect something like owncloud.test.dev. Since he used a subdomain in addition, he might be lucky to get it working by using --name / This is not a problem of the owncloud container, but just an incompatibility of both containers. One would need to check how to rewrite the scripts for the nginx-proxy to accept folders in addtion to FQDN. BTW. The VIRTUAL_HOST variable comes from nginx-proxy as well, it simply tells nginx which domain name it should bind to the particular service.

jujes commented 8 years ago

@greyltc apology for the delay, I test it this week and tell you something :) you have some progress on this? Regards

setiseta commented 8 years ago

the nginx-proxy will work with every domain.(AFAIK) the VIRTUAL_HOST env is to tell nginx which domain, and just the domain, no path, or anything else. this is for me a default container if you use more than one web app on your docker host on default ports, or are there better solution? (tell me plz if so) there are companion containers to do the lets encrypt things, very easy, and automated for every container / domain you connect to the jwilder/nginx-proxy. so with the following 2 containers you get a full lets encrypt automated setup, to connect every web application container: https://hub.docker.com/r/jwilder/nginx-proxy/ https://hub.docker.com/r/jrcs/letsencrypt-nginx-proxy-companion/

(if you reference these, you are not needed to do same things again. and you can get it much easier. maybe smaller images ) [my opinion]

for me its working with: ALLOW_INSECURE=true you need to remove all port bindings from owncloud container, cause nginx-proxy is on these ports, then it should work. and remove the "MYCERT" volume from owncloud, cause its not needed.

but, it seems there is no redis cache module installed in your owncloud container.

Kind Regards