내 nginx 서버의 하위 폴더에 owncloud 인스턴스를 갖고 싶습니다. 하지만 opwncloud에서 요청한 일부 파일에 문제가 있습니다 (CSS 및 js가로드되지 않는 것 같습니다).nginx 및 owncloud 하위 폴더
다음은이 가상 호스트에 대한 nginx를 conf의 파일입니다 :
server {
listen 80;
server_name blackblock.22decembre.eu;
return 301 https://blackblock.22decembre.eu$request_uri;
}
server {
listen 443 default_server ssl;
server_name blackblock.22decembre.eu;
root /srv/www/blackblock/;
access_log /var/log/nginx/blackblock.access.log;
error_log /var/log/nginx/blackblock.errors.log;
index index.html index.php;
# This block will catch static file requests, such as images, css, js
# The : prefix is a "non-capturing" mark, meaning we do not require
# the pattern to be captured into $1 which should help improve performance
location ~* \.(:ico|css|js|gif|jpeg|png)$ {
# Some basic cache-control for static files to be sent to the browser
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
# remove the robots line if you want to use wordpress" virtual robots.txt
# location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
# this prevents hidden files (beginning with a period) from being served
location ~ /\. { access_log off; log_not_found off; deny all; }
#location ~ ^(?<script_name>.+?\.php)(?<path_info>/.*)?$ {
location ~ \.php {
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
fastcgi_pass unix:/run/php5-fpm.sock;
include fastcgi_params;
}
location /roundcube/program/js/tiny_mce/ { alias /usr/share/tinymce/www/; }
location /roundcube/(config|temp|logs) { deny all;}
##### owncloud
location ~ /owncloud/ {
root /srv/www/blackblock/owncloud/;
try_files $uri $uri/ index.php;
#client_max_body_size 10G; # set max upload size
#fastcgi_buffers 64 4K;
rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
location ~ ^/remote.php(/.*)$ {
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_pass unix:/run/php5-fpm.sock;
include fastcgi_params;
}
error_page 403 /core/templates/403.php;
error_page 404 /core/templates/404.php;
location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
deny all;
}
# The following 2 rules are only needed with webfinger
rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
# Optional: set long EXPIRES header on static assets
#location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
# expires 30d;
# Optional: Don't log access to assets
# access_log off;
# }
}
##### torrent (not related to owncloud, flask application)
location = /flask-torrent { rewrite^/flask-torrent/ last; }
}
내가 찾을 수 owncloud가 제대로로드되지 않는 이유! 당신은 웹 사이트를 볼 수 있습니다, 나는 기분이 좋다 : https://blackblock.22decembre.eu/owncloud/ (cacert 인증서). owncloud에 대한 특정 가상 호스트를 시작하면 완벽하게 작동하지만 원하지 않습니다.이 호스트 (블랙 블록)의 하위 폴더에서 선호합니다!
업스트림, 나는 그것에 대해 몰랐습니다! 나는 시도 할 것이다. php5-fpm, 풀 및 소켓이 잘 설정되어 있고 작동하고 있기 때문에 별도의 가상 호스트에 PHP를 실행하는 두 개의 다른 웹 사이트가 있고 두 개 이상의 다른 PHP 서비스가이 별개의 폴더에서 실행되고 있기 때문에 말할 수 있습니다 정확한 가상 호스트. 감사합니다. – 22decembre
많은 문제가 계속 발생합니다. CSS 또는 js 파일을로드 할 수 없습니다. – 22decembre