Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- location / {
- return 301 https://$host$request_uri;
- }
- }
- server
- {
- listen 443 ssl http2 default_server;
- ssl on;
- add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
- ssl_ciphers 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4';
- ssl_prefer_server_ciphers on;
- ssl_session_cache shared:SSL:10m;
- ssl_dhparam /etc/ssl/private/dhparams.pem;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- ssl_certificate /etc/letsencrypt/live/deine.cloud/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/deine.cloud/privkey.pem;
- root /var/www/;
- # set max upload size
- client_max_body_size 1G;
- fastcgi_buffers 64 4K;
- # Disable gzip to avoid the removal of the ETag header
- gzip off;
- #error_page 403 /owncloud/core/templates/403.php;
- #error_page 404 /owncloud/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(?:$|/) {
- include fastcgi_params;
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- # Important: disable HTTPS, otherwise no log in will be possible!
- #fastcgi_param HTTPS on;
- fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice
- fastcgi_param front_controller_active true;
- fastcgi_pass unix:/run/php/php7.0-fpm.sock;
- fastcgi_intercept_errors on;
- # Raise timeout values.
- # This is especially important when the ownCloud setup runs into timeouts (504 gateway errors)
- fastcgi_read_timeout 300;
- fastcgi_send_timeout 300;
- fastcgi_connect_timeout 300;
- # Pass PHP variables directly to PHP.
- # This is usually done in the php.ini. For more flexibility, these variables are configured in the nginx config.
- # All the PHP parameters have to be set in one fastcgi_param. When using more 'fastcgi_param PHP_VALUE' directives, the last one will override all the others.
- fastcgi_param PHP_VALUE "open_basedir=/var/www:/tmp/:/var/owncloud_data:/dev/urandom
- upload_max_filesize = 1G
- post_max_size = 1G
- max_execution_time = 3600";
- }
- location ~ ^/(?:updater|ocs-provider)(?:$|/) {
- try_files $uri/ =404;
- index index.php;
- }
- # Adding the cache control header for js and css files
- # Make sure it is BELOW the PHP block
- location ~* \.(?:css|js)$ {
- try_files $uri /index.php$uri$is_args$args;
- # Optional: Don't log access to assets
- access_log off;
- }
- location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
- try_files $uri /index.php$uri$is_args$args;
- # Optional: Don't log access to other assets
- access_log off;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement