Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80 default;
- server_name localhost '' ' ' 192.168.1.120;
- ##### http://nginx.org/en/docs/http/configuring_https_servers.html
- # listen 443 ssl default_server;
- # ssl_certificate server.full_chain.crt;
- # ssl_certificate_key server.key;
- # ssl_ciphers RC4:HIGH:!aNULL:!MD5;
- # ssl_prefer_server_ciphers on;
- root /var/www/owncloud;
- client_max_body_size 10G;
- fastcgi_buffers 64 4K;
- index index.php index.php5 index.html index.htm;
- #<tweaks>
- location ~ /\. { access_log off; log_not_found off; deny all; }
- location ~ ~$ { access_log off; log_not_found off; deny all; }
- location = /robots.txt { access_log off; log_not_found off; }
- location = /favicon.ico { access_log off; log_not_found off; }
- location ~ /_\.gif$ {
- log_not_found off;
- expires max;
- access_log off;
- empty_gif;
- }
- location ~* \.(jpg|jpeg|gif|css|png|js|ico|html|htm|bmp|tiff|tif|pdf|swf)$ {
- access_log off;
- log_not_found off;
- expires max;
- }
- #</tweaks>
- #<pwncloud>
- rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
- rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
- rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
- location / {
- rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
- rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
- rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
- rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
- rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
- error_page 403 = /core/templates/403.php;
- error_page 404 = /core/templates/404.php;
- try_files $uri $uri/ index.php;
- }
- location ~ ^/(data|config|db_structure\.xml|README) {
- internal;
- access_log off;
- }
- #</pwncloud>
- #<mediawiki>
- rewrite ^/w/index.php/(.*) /w/$1 permanent;
- location /w {
- alias /var/www/mediawiki;
- client_max_body_size 5m;
- client_body_timeout 60;
- try_files $uri $uri/ @rewrite_wiki;
- }
- location @rewrite_wiki {
- rewrite "^/w/([^?]*)(?:\?(.*))?" /w/index.php?title=$1&$args last;
- }
- location ~ ^/w/images/.*\.(html|htm|shtml|php|php5|sh|py|cgi)$ {
- types { }
- default_type text/plain;
- }
- location ~ ^/w/(cache|maintenance|mw-config|includes|serialized|languages)((/.*)?)$ {
- access_log /var/log/nginx/access.log;
- internal;
- }
- location ~* ^/w/.*\.(jpe?g|gif|css|png|js|ico|html|htm|bmp|tiff?|pdf)$ {
- try_files $uri /w/index.php;
- expires max;
- log_not_found off;
- }
- location ~ ^/w/images/ {
- try_files $uri /w/index.php;
- expires max;
- log_not_found off;
- }
- location /w/dumps {
- alias /var/www/mediawiki/local;
- autoindex on;
- }
- #</mediawiki>
- #<file.php via PHP-FPM>
- location ~ [^/]\.php(/|$) {
- fastcgi_split_path_info ^(.+?\.php)(/.*)$;
- if (!-f $document_root$fastcgi_script_name) { return 404; }
- include fastcgi_params;
- fastcgi_pass unix:/run/php5-fpm.sock;
- fastcgi_index index.php;
- }
- #</file.php via PHP-FPM>
- #<file.php5 via PHP-FPM>
- location ~ [^/]\.php5(/|$) {
- fastcgi_split_path_info ^(.+?\.php5)(/.*)$;
- if (!-f $document_root$fastcgi_script_name) { return 404; }
- include fastcgi_params;
- fastcgi_pass unix:/run/php5-fpm.sock;
- fastcgi_index index.php5;
- }
- #</file.php5 via PHP-FPM>
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement