Guest User

Untitled

a guest
Jan 12th, 2021
1,753
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 4.48 KB | None | 0 0
  1. upstream php-handler {
  2.    # server 127.0.0.1:9000;
  3.     server unix:/var/run/php/php7.4-fpm.sock;
  4. }
  5. server {
  6.     server_name cloud.theroccos.us;
  7.     add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
  8.     client_max_body_size 10240M;
  9.     fastcgi_buffers 64 4K;
  10.     gzip on;
  11.     gzip_vary on;
  12.     gzip_comp_level 4;
  13.     gzip_min_length 256;
  14.     gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
  15.     gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
  16.     add_header Referrer-Policy                      "no-referrer"   always;
  17.     add_header X-Content-Type-Options               "nosniff"       always;
  18.     add_header X-Download-Options                   "noopen"        always;
  19.     add_header X-Frame-Options                      "SAMEORIGIN"    always;
  20.     add_header X-Permitted-Cross-Domain-Policies    "none"          always;
  21.     add_header X-Robots-Tag                         "none"          always;
  22.     add_header X-XSS-Protection                     "1; mode=block" always;
  23.     fastcgi_hide_header X-Powered-By;
  24.     fastcgi_hide_header X-Powered-By;
  25.     fastcgi_read_timeout 3600;
  26.     fastcgi_send_timeout 3600;
  27.     fastcgi_connect_timeout 3600;
  28.     root /var/www/html/nextcloud;
  29.     index index.php index.html /index.php$request_uri;
  30.     expires 1m;
  31.     location = / {
  32.         if ( $http_user_agent ~ ^DavClnt ) {
  33.             return 302 /remote.php/webdav/$is_args$args;
  34.         }
  35.     }
  36.     location /netdata {
  37.        return 301 /netdata/;
  38.         }
  39.     location ~ /netdata/(?<ndpath>.*) {
  40.     auth_basic "Bitte Zugangsdaten eingeben";
  41.     auth_basic_user_file /etc/nginx/netdata-access;
  42.     proxy_http_version 1.1;
  43.     proxy_pass_request_headers on;
  44.     proxy_set_header Connection "keep-alive";
  45.     proxy_store off;
  46.     proxy_pass http://netdata/$ndpath$is_args$args;
  47.     gzip on;
  48.     gzip_proxied any;
  49.     gzip_types *;
  50. }
  51.  
  52.     location = /robots.txt {
  53.         allow all;
  54.         log_not_found off;
  55.         access_log off;
  56.     }
  57.     location ^~ /apps/rainloop/app/data {
  58.     deny all;
  59.     }
  60.     location ^~ /.well-known {
  61.         location = /.well-known/carddav     { return 301 /remote.php/dav/; }
  62.         location = /.well-known/caldav      { return 301 /remote.php/dav/; }
  63.         location ^~ /.well-known            { return 301 /index.php/$uri; }
  64.         try_files $uri $uri/ =404;
  65.     }
  66.     location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/)  { return 404; }
  67.     location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console)                { return 404; }
  68.     location ~ \.php(?:$|/) {
  69.         fastcgi_split_path_info ^(.+?\.php)(/.*)$;
  70.         set $path_info $fastcgi_path_info;
  71.         try_files $fastcgi_script_name =404;
  72.         include fastcgi_params;
  73.         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  74.         fastcgi_param PATH_INFO $path_info;
  75.         fastcgi_param HTTPS on;
  76.         fastcgi_param modHeadersAvailable true;
  77.         fastcgi_param front_controller_active true;
  78.         fastcgi_pass php-handler;
  79.         fastcgi_intercept_errors on;
  80.         fastcgi_request_buffering off;
  81.     }
  82.     location ~ \.(?:css|js|svg|gif)$ {
  83.         try_files $uri /index.php$request_uri;
  84.         expires 6M;
  85.         access_log off;
  86.     }
  87.     location ~ \.woff2?$ {
  88.         try_files $uri /index.php$request_uri;
  89.         expires 7d;
  90.         access_log off;
  91.     }
  92.     location / {
  93.         try_files $uri $uri/ /index.php$request_uri;
  94.     }
  95.  
  96.  
  97.     listen 443 ssl; # managed by Certbot
  98.     ssl_certificate /etc/letsencrypt/live/theroccos.us/fullchain.pem; # managed by Certbot
  99.     ssl_certificate_key /etc/letsencrypt/live/theroccos.us/privkey.pem; # managed by Certbot
  100.     include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  101.     ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  102.  
  103. }
  104.  
  105. server {
  106.     if ($host = cloud.theroccos.us) {
  107.         return 301 https://$host$request_uri;
  108.     } # managed by Certbot
  109.  
  110.  
  111.     server_name cloud.theroccos.us;
  112.     listen 80;
  113.     return 404; # managed by Certbot
  114.  
  115.  
  116. }
  117.  
Advertisement
Add Comment
Please, Sign In to add comment