I'm running the image with persistent data, conf and app volumes. I am dealing the classic "blank page" scenario so I have followed the documentation on owncloud.org that suggests using the following configuration for owncloud 8.2-fpm:
upstream php-handler {
server 127.0.0.1:9000;
#server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name cloud.example.com;
# enforce https
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name cloud.example.com;
ssl_certificate /etc/ssl/nginx/cloud.example.com.crt;
ssl_certificate_key /etc/ssl/nginx/cloud.example.com.key;
# Add headers to serve security related headers
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
# Path to the root of your installation
root /var/www/owncloud/;
# set max upload size
client_max_body_size 10G;
fastcgi_buffers 64 4K;
# Disable gzip to avoid the removal of the ETag header
gzip off;
# Uncomment if your server is build with the ngx_pagespeed module
# This module is currently not supported.
#pagespeed off;
index index.php;
error_page 403 /core/templates/403.php;
error_page 404 /core/templates/404.php;
rewrite ^/.well-known/carddav /remote.php/carddav/ permanent;
rewrite ^/.well-known/caldav /remote.php/caldav/ permanent;
# The following 2 rules are only needed for the user_webfinger app.
# Uncomment it if you're planning to use this app.
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ ^/(build|tests|config|lib|3rdparty|templates|data)/ {
deny all;
}
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
deny all;
}
location / {
rewrite ^/remote/(.*) /remote.php last;
rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
try_files $uri $uri/ =404;
}
location ~ \.php(?:$|/) {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS on;
fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice
fastcgi_pass php-handler;
fastcgi_intercept_errors on;
}
# Adding the cache control header for js and css files
# Make sure it is BELOW the location ~ \.php(?:$|/) { block
location ~* \.(?:css|js)$ {
add_header Cache-Control "public, max-age=7200";
# Add headers to serve security related headers
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
# Optional: Don't log access to assets
access_log off;
}
# Optional: Don't log access to other assets
location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|swf)$ {
access_log off;
}
}
This is pretty much exactly my configuration at the moment where root is changed to /var/www/html/
, upstream php-handler (server) is changed to owncloud:9000
(as my nginx-container has linked this service) and my ssl-keys and the server names to the correct domain. (refered to example.com henceforth)
This setup gives me a blank page on the https://example.com/ but shows me the first-time form on https://example.com/index.php however the css, js and images are not loaded.
logs show the following when requesting "https://example.com/":
Nginx:
director_1 | 192.168.1.1 - - [22/Feb/2016:10:49:12 +0000] "GET / HTTP/1.1" 404 5 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0" "-"
(owncloud logs show no activity)
logs show the following when requesting https://example.com/index.php:
nginx:
director_1 | 192.168.1.1 - - [22/Feb/2016:10:54:58 +0000] "GET /core/js/avatar.js?v=fa9b0536472c7e6ce28a5a7d8703afc7 HTTP/1.1" 404 5 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0" "-"
director_1 | 2016/02/22 10:54:58 [error] 6#6: *259 open() "/var/www/html/core/vendor/strengthify/jquery.strengthify.js" failed (2: No such file or directory), client: 192.168.1.1, server: example.com, request: "GET /core/vendor/strengthify/jquery.strengthify.js?v=fa9b0536472c7e6ce28a5a7d8703afc7 HTTP/1.1", host: "example.com"
director_1 | 192.168.1.1 - - [22/Feb/2016:10:54:58 +0000] "GET /core/vendor/strengthify/jquery.strengthify.js?v=fa9b0536472c7e6ce28a5a7d8703afc7 HTTP/1.1" 404 5 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0" "-"
director_1 | 2016/02/22 10:54:58 [error] 6#6: *259 open() "/var/www/html/core/js/setup.js" failed (2: No such file or directory), client: 192.168.1.1, server: example.com, request: "GET /core/js/setup.js?v=fa9b0536472c7e6ce28a5a7d8703afc7 HTTP/1.1", host: "example.com"
director_1 | 192.168.1.1 - - [22/Feb/2016:10:54:58 +0000] "GET /core/js/setup.js?v=fa9b0536472c7e6ce28a5a7d8703afc7 HTTP/1.1" 404 5 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0" "-"
director_1 | 2016/02/22 10:54:58 [error] 6#6: *259 open() "/var/www/html/core/js/jquery-showpassword.js" failed (2: No such file or directory), client: 192.168.1.1, server: example.com request: "GET /core/js/jquery-showpassword.js?v=fa9b0536472c7e6ce28a5a7d8703afc7 HTTP/1.1", host: "example.com"
director_1 | 192.168.1.1 - - [22/Feb/2016:10:54:58 +0000] "GET /core/js/jquery-showpassword.js?v=fa9b0536472c7e6ce28a5a7d8703afc7 HTTP/1.1" 404 5 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0" "-"
director_1 | 2016/02/22 10:54:58 [error] 6#6: *259 open() "/var/www/html/core/js/installation.js" failed (2: No such file or directory), client: 192.168.1.1, server: example.com, request: "GET /core/js/installation.js?v=fa9b0536472c7e6ce28a5a7d8703afc7 HTTP/1.1", host: "example.com"
director_1 | 192.168.1.1 - - [22/Feb/2016:10:54:59 +0000] "GET /core/js/installation.js?v=fa9b0536472c7e6ce28a5a7d8703afc7 HTTP/1.1" 404 5 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0" "-"
director_1 | 192.168.1.1 - - [22/Feb/2016:10:54:59 +0000] "GET /core/img/actions/caret.svg HTTP/1.1" 404 5 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0" "-"
owncloud logs:
...
owncloud_1 | 172.17.0.5 - 22/Feb/2016:10:47:57 +0000 "GET /core/templates/404.php" 302
owncloud_1 | 172.17.0.5 - 22/Feb/2016:10:47:57 +0000 "GET /core/templates/404.php" 302
owncloud_1 | 172.17.0.5 - 22/Feb/2016:10:47:57 +0000 "GET /core/templates/404.php" 302
Docker-compose configuration:
owncloud docker-compose.yml:
owncloud:
image: owncloud:8.2-fpm
volumes:
- /storage/containerdata/home_owncloud/apps:/var/www/html/apps
- /storage/containerdata/home_owncloud/config:/var/www/html/config
- /storage/owncloud:/var/www/html/data
relevant part of nginx docker-compose.yml
director:
# build: docker-nginx
image: nginx:latest
restart: always
volumes:
- storage ...
...
ports:
- "80:80"
- "443:443"
external_links:
- somewhere_owncloud_1:owncloud