Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- upstream php-handler {
- server unix:/run/php/php7.0-fpm.sock;
- }
- fastcgi_cache_path /usr/local/tmp/cache levels=1:2 keys_zone=NEXTCLOUD:100m inactive=60m;
- fastcgi_cache_key $scheme$request_method$host$request_uri;
- map $request_uri $skip_cache {
- default 1;
- ~*/thumbnail.php 0;
- ~*/apps/galleryplus/ 0;
- ~*/apps/gallery/ 0;
- }
- server {
- listen 80;
- server_name mycloud.dyndns.org;
- return 301 https://$server_name$request_uri;
- }
- server {
- listen 443 ssl http2;
- server_name mycloud.dyndns.org;
- ssl_certificate /etc/letsencrypt/live/mycloud.dyndns.org/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/mycloud.dyndns.org/privkey.pem;
- ssl_protocols TLSv1.2;
- ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK';
- ssl_dhparam /etc/ssl/certs/dhparam.pem;
- ssl_ecdh_curve secp384r1;
- ssl_prefer_server_ciphers on;
- ssl_stapling on;
- ssl_stapling_verify on;
- resolver 80.10.246.130;
- ssl_trusted_certificate /etc/letsencrypt/live/mycloud.dyndns.org/fullchain.pem;
- ssl_session_timeout 24h;
- ssl_session_cache shared:SSL:50m;
- ssl_session_tickets off;
- 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;
- add_header X-Download-Options noopen;
- add_header X-Permitted-Cross-Domain-Policies none;
- root /var/www/nextcloud/;
- location = /robots.txt {
- allow all;
- log_not_found off;
- access_log off;
- }
- location ^~ /.well-known/acme-challenge {
- default_type text/plain;
- root /var/www/letsencrypt;
- }
- location = /.well-known/carddav { return 301
- $scheme://$host/remote.php/dav; }
- location = /.well-known/caldav { return 301
- $scheme://$host/remote.php/dav; }
- client_max_body_size 1G;
- fastcgi_buffers 64 4K;
- gzip on;
- gzip_vary on;
- gzip_types application/javascript application/x-javascript text/javascript text/xml text/css;
- # or set "gzip off;"
- error_page 403 /core/templates/403.php;
- error_page 404 /core/templates/404.php;
- location / {
- rewrite ^ /index.php$uri;
- }
- location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
- deny all;
- }
- location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
- deny all;
- }
- location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.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;
- fastcgi_param front_controller_active true;
- fastcgi_pass php-handler;
- fastcgi_intercept_errors on;
- fastcgi_request_buffering off;
- fastcgi_read_timeout 300;
- fastcgi_send_timeout 300;
- fastcgi_connect_timeout 300;
- fastcgi_cache_bypass $skip_cache;
- fastcgi_no_cache $skip_cache;
- fastcgi_cache NEXTCLOUD;
- fastcgi_cache_valid 60m;
- fastcgi_cache_methods GET HEAD;
- }
- location ~ ^/(?:updater|ocs-provider)(?:$|/) {
- try_files $uri/ =404;
- index index.php;
- }
- location ~* \.(?:css|js)$ {
- try_files $uri /index.php$uri$is_args$args;
- add_header Cache-Control "public, max-age=7200";
- 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;
- add_header X-Download-Options noopen;
- add_header X-Permitted-Cross-Domain-Policies none;
- access_log off;
- }
- location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
- try_files $uri /index.php$uri$is_args$args;
- access_log off;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement