#user nobody; worker_processes 4; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; gzip off; gzip_vary on; gzip_proxied any; gzip_comp_level 9; gzip_http_version 1.1; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+r$ ssl_certificate /usr/local/etc/letsencrypt.sh/certs/freenasowncloud.info/fullchain.pem; ssl_certificate_key /usr/local/etc/letsencrypt.sh/certs/freenasowncloud.info/privkey.pem; server { listen 443 ssl; root /usr/local/www; location = /robots.txt { allow all; access_log off; log_not_found off; } location = /favicon.ico { access_log off; log_not_found off; } location ^~ /owncloud { index index.php; try_files $uri $uri/ /index.php?$args; client_max_body_size 10240M; location ~ ^/owncloud/(?:\.|data|config|db_structure\.xml|README) { deny all; } rewrite ^/owncloud/apps/([^/]+)/(.+\.(css|php))$ /owncloud/index.php?app=$1&getfile=$2 last; rewrite ^/owncloud/remote/(.*)$ /owncloud/remote.php/$1 last; location ~ \.php/? { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php-fpm.sock; include fastcgi_params; } location ~* \.(?:jpg|gif|ico|png|css|js|svg)$ { expires max; add_header Cache-Control public; } } } }