Guest User

Untitled

a guest
Nov 12th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. server {
  2. listen 80;
  3. server_name owncloud;
  4. return 301 https://$server_name$request_uri; # enforce https
  5. }
  6.  
  7. server {
  8. listen 443 ssl;
  9. server_name owncloud;
  10.  
  11. ssl_certificate /etc/nginx/certificates/owncloud.crt;
  12. ssl_certificate_key /etc/nginx/certificates/owncloud.key;
  13.  
  14. # Path to the root of your installation
  15. root /usr/share/webapps/owncloud;
  16. # set max upload size
  17. client_max_body_size 10G;
  18. fastcgi_buffers 64 4K;
  19.  
  20. rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
  21. rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
  22. rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
  23.  
  24. index index.php;
  25. error_page 403 /core/templates/403.php;
  26. error_page 404 /core/templates/404.php;
  27.  
  28. location = /robots.txt {
  29. allow all;
  30. log_not_found off;
  31. access_log off;
  32. }
  33.  
  34. location ~ ^(.+\.php)(.*)$ {
  35. include uwsgi_params;
  36. uwsgi_modifier1 14;
  37. uwsgi_pass 127.0.0.1:3001;
  38. }
  39.  
  40. location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
  41. deny all;
  42. }
  43.  
  44. location / {
  45. # The following 2 rules are only needed with webfinger
  46. # rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
  47. # rewrite ^/.well-known/host-meta.json/public.php?service=host-meta-jsonlast;
  48.  
  49. rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
  50. rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
  51.  
  52. rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
  53.  
  54. try_files $uri $uri/ index.php;
  55. }
  56.  
  57. location ~ \.php(?:$|/) {
  58. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  59. include fastcgi_params;
  60. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  61. fastcgi_param PATH_INFO $fastcgi_path_info;
  62. fastcgi_param HTTPS on;
  63. #fastcgi_pass php-handler;
  64. }
  65.  
  66. # Optional: set long EXPIRES header on static assets
  67. location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
  68. expires 30d;
  69. # Optional: Don't log access to assets
  70. access_log off;
  71. }
  72.  
  73. }
Advertisement
Add Comment
Please, Sign In to add comment