2016-07-30 18:57:58 +02:00
|
|
|
worker_processes auto;
|
2016-09-16 17:08:06 +02:00
|
|
|
pid /tmp/nginx.pid;
|
2016-07-30 18:57:58 +02:00
|
|
|
daemon off;
|
|
|
|
|
|
|
|
events {
|
|
|
|
worker_connections 1024;
|
|
|
|
use epoll;
|
|
|
|
}
|
|
|
|
|
|
|
|
http {
|
|
|
|
include /etc/nginx/mime.types;
|
|
|
|
default_type application/octet-stream;
|
|
|
|
|
|
|
|
access_log off;
|
2016-09-18 02:14:17 +02:00
|
|
|
error_log /tmp/ngx_error.log error;
|
2016-07-30 18:57:58 +02:00
|
|
|
|
|
|
|
sendfile on;
|
|
|
|
keepalive_timeout 15;
|
|
|
|
keepalive_disable msie6;
|
|
|
|
keepalive_requests 100;
|
|
|
|
tcp_nopush on;
|
|
|
|
tcp_nodelay on;
|
|
|
|
server_tokens off;
|
|
|
|
|
|
|
|
fastcgi_temp_path /tmp/fastcgi 1 2;
|
|
|
|
client_body_temp_path /tmp/client_body 1 2;
|
2016-09-16 22:15:23 +02:00
|
|
|
proxy_temp_path /tmp/proxy 1 2;
|
2016-09-16 23:41:57 +02:00
|
|
|
uwsgi_temp_path /tmp/uwsgi 1 2;
|
2016-09-17 00:39:11 +02:00
|
|
|
scgi_temp_path /tmp/scgi 1 2;
|
2016-07-30 18:57:58 +02:00
|
|
|
|
2016-09-19 12:11:11 +02:00
|
|
|
gzip off;
|
2016-07-30 18:57:58 +02:00
|
|
|
|
|
|
|
server {
|
2016-09-16 17:08:06 +02:00
|
|
|
listen 8888;
|
2016-07-30 18:57:58 +02:00
|
|
|
root /nextcloud;
|
2016-09-19 12:11:11 +02:00
|
|
|
|
2016-09-19 12:59:09 +02:00
|
|
|
client_max_body_size <UPLOAD_MAX_SIZE>;
|
2016-07-30 18:57:58 +02:00
|
|
|
fastcgi_buffers 64 4K;
|
2016-09-19 12:11:11 +02:00
|
|
|
|
2016-07-30 18:57:58 +02:00
|
|
|
error_page 403 /core/templates/403.php;
|
|
|
|
error_page 404 /core/templates/404.php;
|
|
|
|
|
2016-09-28 23:15:22 +02:00
|
|
|
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload";
|
2016-09-19 12:11:11 +02:00
|
|
|
add_header X-Frame-Options "SAMEORIGIN";
|
2016-07-30 18:57:58 +02:00
|
|
|
add_header X-Content-Type-Options nosniff;
|
|
|
|
add_header X-XSS-Protection "1; mode=block";
|
|
|
|
add_header X-Robots-Tag none;
|
|
|
|
add_header X-Download-Options noopen;
|
|
|
|
add_header X-Permitted-Cross-Domain-Policies none;
|
|
|
|
|
|
|
|
location = /robots.txt {
|
|
|
|
allow all;
|
|
|
|
log_not_found off;
|
|
|
|
access_log off;
|
|
|
|
}
|
|
|
|
|
2016-09-19 12:11:11 +02:00
|
|
|
location = /.well-known/carddav {
|
|
|
|
return 301 $scheme://$host/remote.php/dav;
|
|
|
|
}
|
|
|
|
|
|
|
|
location = /.well-known/caldav {
|
|
|
|
return 301 $scheme://$host/remote.php/dav;
|
2016-07-30 18:57:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
location / {
|
2016-09-19 12:11:11 +02:00
|
|
|
rewrite ^ /index.php$uri;
|
|
|
|
}
|
|
|
|
|
|
|
|
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
|
|
|
|
deny all;
|
2016-07-30 18:57:58 +02:00
|
|
|
}
|
|
|
|
|
2016-09-19 12:11:11 +02:00
|
|
|
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
|
|
|
|
deny all;
|
|
|
|
}
|
|
|
|
|
|
|
|
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
|
2016-07-30 18:57:58 +02:00
|
|
|
include fastcgi_params;
|
2016-09-19 12:11:11 +02:00
|
|
|
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
|
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
|
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
2016-07-30 18:57:58 +02:00
|
|
|
fastcgi_param modHeadersAvailable true;
|
2016-09-19 12:11:11 +02:00
|
|
|
fastcgi_param front_controller_active true;
|
2016-09-16 17:08:06 +02:00
|
|
|
fastcgi_pass unix:/tmp/php-fpm.sock;
|
2016-09-19 12:11:11 +02:00
|
|
|
fastcgi_intercept_errors on;
|
|
|
|
fastcgi_request_buffering off;
|
2016-09-16 22:19:25 +02:00
|
|
|
fastcgi_read_timeout 1200;
|
2016-07-30 18:57:58 +02:00
|
|
|
}
|
|
|
|
|
2016-09-19 12:11:11 +02:00
|
|
|
location ~ ^/(?:updater|ocs-provider)(?:$|/) {
|
|
|
|
try_files $uri/ =404;
|
|
|
|
index index.php;
|
|
|
|
}
|
|
|
|
|
|
|
|
location ~* \.(?:css|js)$ {
|
|
|
|
try_files $uri /index.php$uri$is_args$args;
|
|
|
|
add_header Cache-Control "public, max-age=7200";
|
|
|
|
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
|
|
|
|
add_header X-Frame-Options "SAMEORIGIN";
|
|
|
|
add_header X-Content-Type-Options nosniff;
|
|
|
|
add_header X-XSS-Protection "1; mode=block";
|
|
|
|
add_header X-Robots-Tag none;
|
|
|
|
add_header X-Download-Options noopen;
|
|
|
|
add_header X-Permitted-Cross-Domain-Policies none;
|
|
|
|
access_log off;
|
|
|
|
}
|
|
|
|
|
|
|
|
location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
|
2016-09-22 17:07:10 +02:00
|
|
|
try_files $uri /index.php$uri$is_args$args;
|
2016-07-30 18:57:58 +02:00
|
|
|
access_log off;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|