Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- php-handler7, server block, ssl stuff.
- ..
- ..
- Nextcloud config:
- add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload";
- add_header X-Content-Type-Options nosniff;
- add_header X-Robots-Tag none;
- add_header X-Download-Options noopen;
- add_header X-Permitted-Cross-Domain-Policies none;
- add_header X-Frame-Options "SAMEORIGIN";
- add_header X-XSS-Protection "1; mode=block";
- root /var/www/foo.bar;
- client_max_body_size 10G;
- fastcgi_buffers 64 4K;
- create_full_put_path on;
- dav_access user:rw group:rw all:r;
- index index.php;
- error_page 403 /nextcloud/core/templates/403.php;
- error_page 404 /nextcloud/core/templates/404.php;
- location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
- deny all;
- }
- location ~ ^/nextcloud(build|tests|config|lib|3rdparty|templates|data)/ {
- deny all;
- }
- location ~ ^/nextcloud(?:\.|autotest|occ|issue|indie|db_|console) {
- deny all;
- }
- location = /.well-known/carddav {
- return 301 $scheme://$host/owncloud/remote.php/dav;
- }
- location = /.well-known/caldav {
- return 301 $scheme://$host/owncloud/remote.php/dav;
- }
- location = /.well-known/acme-challenge { }
- location /nextcloud {
- rewrite ^ /nextcloud/index.php$uri;
- }
- location ~ ^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)/ {
- deny all;
- }
- location ~ ^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console) {
- deny all;
- }
- location ~ ^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
- include fastcgi_params;
- dav_methods PUT DELETE MKCOL COPY MOVE;
- dav_ext_methods PROPFIND OPTIONS;
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- fastcgi_param HTTPS on;
- #Avoid sending the security headers twice
- fastcgi_param modHeadersAvailable true;
- fastcgi_param front_controller_active true;
- fastcgi_pass php-handler7;
- fastcgi_intercept_errors on;
- fastcgi_request_buffering off;
- }
- location ~ ^/nextcloud/(?:updater|ocs-provider)(?:$|/) {
- try_files $uri/ =404;
- index index.php;
- }
- location ~* \.(?:css|js)$ {
- try_files $uri /nextcloud/index.php$uri$is_args$args;
- }
- location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
- try_files $uri /nextcloud/index.php$uri$is_args$args;
- # Optional: Don't log access to other assets
- access_log off;
- }
- # PHP block for all NON nextcloud php files
- location ~ (.*\.php)$ {
- include fastcgi_params;
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- 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_intercept_errors on;
- fastcgi_request_buffering off;
- fastcgi_pass php-handler7;
- }
- location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
- expires 30d;
- access_log on;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement