## Change the following line to match the number of threads you have ### worker_processes 4; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' access_log logs/access.log main; sendfile off; #keepalive_timeout 0; keepalive_timeout 65; gzip off; #SSL ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; ssl_ciphers ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM; ssl_prefer_server_ciphers on; ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; server { listen 80; ### Change the following two lines to match your environment ### server_name myserver.dyndny.com; return 301 https://myserver.dyndns.com$request_uri; #add_header X-Frame-Options "SAMEORIGIN"; # Prevent Clickjacking } server { listen 443 ssl; ## Change the following line to match your environment ### server_name myserver.dyndns.com; root /usr/local/www/owncloud; #add_header X-Frame-Options "SAMEORIGIN"; # Prevent Clickacking ## Change the following lines to match your environment ### # SSL Settings ssl_certificate /usr/local/etc/nginx/certs/ssl.crt; ssl_certificate_key /usr/local/etc/nginx/certs/ssl.key; add_header Strict-Transport-Security "max-age=16070400; includeSubdomains"; # Force the use of SSL error_page 403 = /core/templates/403.php; error_page 404 = /core/templates/404.php; rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect; rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect; rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect; location = /robots.txt { allow all; access_log off; log_not_found off; } location = /favicon.ico { access_log off; log_not_found off; } location ^~ / { index index.php; try_files $uri $uri/ /index.php?$args; client_max_body_size 2048M; location ~ ^/(?:\.|data|config|db_structure\.xml|README) { deny all; } location ~ \.php(?:$|/) { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; include fastcgi_params; fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on; } location ~* \.(?:jpg|gif|ico|png|css|js|svg)$ { expires max; add_header Cache-Control public; } location ^~ /data { internal; ## Change the following line to match your environment ### alias /mnt/files; } } } }