Advertisement
Guest User

Nextcloud Nginx Config

a guest
May 11th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4. root /var/www/nextcloud/;
  5. server_name nextcloud.mydomainname.com;
  6. access_log /home/nextcloud/nginx/logs/nginx.access.log;
  7. error_log /home/nextcloud/nginx/logs/nginx.error.log;
  8. index index.php index.html index.htm;
  9.  
  10. location / {
  11. rewrite ^ /index.php$uri;
  12. }
  13.  
  14. location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
  15. return 404;
  16. }
  17. location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
  18. return 404;
  19. }
  20.  
  21. location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
  22. fastcgi_split_path_info ^(.+\.php)(/.*)$;
  23. fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; # Ubuntu 17.04
  24. include fastcgi_params;
  25. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  26. fastcgi_param PATH_INFO $fastcgi_path_info;
  27. fastcgi_intercept_errors on;
  28. fastcgi_request_buffering off;
  29. }
  30.  
  31.  
  32. location ~ ^/(?:updater|ocs-provider)(?:$|/) {
  33. try_files $uri $uri/ =404;
  34. index index.php;
  35. }
  36.  
  37. location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
  38. try_files $uri /index.php$uri$is_args$args;
  39. access_log off;
  40. }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement