daily pastebin goal
17%
SHARE
TWEET

nginx conf

surovovoleg Jun 21st, 2018 3 in 363 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server {
  2.     server_name clxxxxxxx www.clxxxxxxx;
  3.     listen XX.XX.XX.XX:80;
  4.     return 301 https://$server_name$request_uri;
  5. }
  6.  
  7. server {
  8.     server_name clxxxxxxx www.clxxxxxxx;
  9.     listen XX.XX.XX.XX:443 http2;
  10.     ssl on;
  11.     ssl_certificate "/var/www/httpd-cert/xxxxxxx/clxxxxxxx_le1.crtca";
  12.     ssl_certificate_key "/var/www/httpd-cert/xxxxxxx/clxxxxxxx_le1.key";
  13.    
  14.     charset UTF-8;
  15.     access_log off;    
  16.     ssi on;
  17.     error_log /var/www/httpd-logs/clxxxxxxx.error.log notice;
  18.    
  19.     set $root_path /var/www/xxxxxxx/data/www/clxxxxxxx;
  20.     root $root_path;
  21.    
  22.     location = /robots.txt {
  23.         allow all;
  24.         log_not_found off;
  25.         access_log off;
  26.     }
  27.  
  28.     rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
  29.     rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json;
  30.    
  31.     location = /.well-known/carddav {
  32.       return 301 $scheme://$host/remote.php/dav;
  33.     }
  34.    
  35.     location = /.well-known/caldav {
  36.       return 301 $scheme://$host/remote.php/dav;
  37.     }
  38.    
  39.     client_max_body_size 128M;
  40.     fastcgi_buffers 64 4K;
  41.    
  42.     gzip on;
  43.     gzip_vary on;
  44.     gzip_comp_level 4;
  45.     gzip_min_length 256;
  46.     gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
  47.     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;
  48.  
  49.     error_page 403 https://clxxxxxxx/core/templates/403.php;
  50.     error_page 404 https://clxxxxxxx/core/templates/404.php;
  51.  
  52.     location / {
  53.         rewrite ^ /index.php$uri;
  54.     }
  55.    
  56.     location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
  57.         deny all;
  58.     }
  59.    
  60.     location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
  61.         deny all;
  62.     }
  63.    
  64.     location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
  65.         deny all;
  66.     }
  67.    
  68.     location ~* ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
  69.         fastcgi_split_path_info ^(.+?\.php)(/.*)$;
  70.         set $path_info $fastcgi_path_info;
  71.         try_files $fastcgi_script_name =404;
  72.         fastcgi_param PATH_INFO $path_info;
  73.         fastcgi_param PATH_INFO $fastcgi_path_info;
  74.         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  75.         fastcgi_param HTTPS on;
  76.         fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on;
  77.         fastcgi_param front_controller_active true;
  78.         fastcgi_pass unix:/var/www/php-fpm/xxxxxxx.sock;
  79.         fastcgi_intercept_errors on;
  80.         fastcgi_request_buffering off;
  81.         fastcgi_pass_header Authorization;
  82.         fastcgi_param modHeadersAvailable true;
  83.         include fastcgi_params;
  84.         fastcgi_buffering off;
  85.         fastcgi_param PATH "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin";
  86.     }
  87.    
  88.     location ~ ^/(?:updater|ocs-provider)(?:$|/) {
  89.         try_files $uri/ =404;
  90.         index index.php;
  91.     }
  92.    
  93.     location ~ \.(?:css|js|woff|svg|gif)$ {
  94.         try_files $uri /index.php$uri$is_args$args;
  95.         add_header Cache-Control "public, max-age=15778463";
  96.         add_header X-Content-Type-Options nosniff;
  97.         add_header X-XSS-Protection "1; mode=block";
  98.         add_header X-Robots-Tag none;
  99.         add_header X-Download-Options noopen;
  100.         add_header X-Permitted-Cross-Domain-Policies none;
  101.         access_log off;
  102.     }
  103.    
  104.     location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
  105.         try_files $uri /index.php$uri$is_args$args;
  106.         access_log off;
  107.     }
  108.  
  109. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top