109 lines
3.1 KiB
Nginx Configuration File
Raw Normal View History

2016-04-11 15:59:32 +02:00
worker_processes auto;
2016-09-16 17:08:06 +02:00
pid /tmp/nginx.pid;
2016-04-11 15:59:32 +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-04-11 15:59:32 +02:00
sendfile on;
keepalive_timeout 15;
keepalive_disable msie6;
keepalive_requests 100;
tcp_nopush on;
2016-04-13 13:54:30 +02:00
tcp_nodelay on;
2016-04-11 15:59:32 +02:00
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;
uwsgi_temp_path /tmp/uwsgi 1 2;
scgi_temp_path /tmp/scgi 1 2;
2016-04-11 15:59:32 +02:00
gzip on;
gzip_comp_level 5;
gzip_min_length 512;
gzip_buffers 4 8k;
gzip_proxied any;
gzip_vary on;
gzip_disable "msie6";
gzip_types
text/css
text/javascript
text/xml
text/plain
text/x-component
application/javascript
application/x-javascript
application/json
application/xml
application/rss+xml
application/vnd.ms-fontobject
font/truetype
font/opentype
image/svg+xml;
server {
2016-09-16 17:08:06 +02:00
listen 8888;
2016-04-11 15:59:32 +02:00
index index.php;
2016-06-16 12:54:04 +02:00
root /nextcloud;
2016-04-11 15:59:32 +02:00
client_max_body_size 10G;
fastcgi_buffers 64 4K;
rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
error_page 403 /core/templates/403.php;
error_page 404 /core/templates/404.php;
2016-04-13 13:52:19 +02:00
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
2016-04-13 13:52:19 +02:00
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
2016-04-13 14:13:42 +02:00
add_header X-Robots-Tag none;
2016-04-13 14:24:03 +02:00
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
2016-04-11 15:59:32 +02:00
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
deny all;
}
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;
try_files $uri $uri/ index.php;
}
location ~ ^(.+?\.php)(/.*)?$ {
try_files $1 = 404;
include fastcgi_params;
2016-04-13 14:13:42 +02:00
fastcgi_param modHeadersAvailable true;
2016-04-11 15:59:32 +02:00
fastcgi_param SCRIPT_FILENAME $document_root$1;
fastcgi_param PATH_INFO $2;
2016-09-16 17:08:06 +02:00
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_read_timeout 1200;
2016-04-11 15:59:32 +02:00
}
location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
expires 30d;
access_log off;
}
}
}