85 lines
3.1 KiB
Nginx Configuration File
Raw Normal View History

2017-05-02 14:22:18 +02:00
server {
listen 8888;
root /nextcloud;
2017-05-02 14:22:18 +02:00
fastcgi_buffers 64 4K;
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
add_header Referrer-Policy "no-referrer" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Download-Options "noopen" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Permitted-Cross-Domain-Policies "none" always;
add_header X-Robots-Tag "none" always;
add_header X-XSS-Protection "1; mode=block" always;
2018-12-10 13:39:26 +01:00
2017-05-02 14:22:18 +02:00
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
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/webfinger /public.php?service=webfinger last;
2017-05-02 14:22:18 +02:00
location = /.well-known/carddav {
2018-10-31 10:59:42 +01:00
return 301 https://$host/remote.php/dav;
2017-05-02 14:22:18 +02:00
}
location = /.well-known/caldav {
2018-10-31 10:59:42 +01:00
return 301 https://$host/remote.php/dav;
2017-05-02 14:22:18 +02:00
}
location / {
2018-12-10 13:39:26 +01:00
rewrite ^ /index.php$request_uri;
2017-05-02 14:22:18 +02:00
}
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
deny all;
}
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
deny all;
}
2019-04-12 10:49:07 +02:00
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|oc[ms]-provider/.+)\.php(?:$|/) {
2017-05-02 14:22:18 +02:00
include /nginx/conf/fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
2018-12-10 13:39:26 +01:00
fastcgi_hide_header X-Powered-By;
2017-05-02 14:22:18 +02:00
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param modHeadersAvailable true;
fastcgi_param front_controller_active true;
fastcgi_pass unix:/php/run/php-fpm.sock;
fastcgi_intercept_errors off;
2017-05-02 14:22:18 +02:00
fastcgi_request_buffering off;
fastcgi_read_timeout 1200;
}
2019-04-12 10:49:07 +02:00
location ~ ^/(?:updater|oc[ms]-provider)(?:$|/) {
2017-05-02 14:22:18 +02:00
try_files $uri/ =404;
index index.php;
}
location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
2018-12-10 13:39:26 +01:00
try_files $uri /index.php$request_uri;
2017-05-02 14:22:18 +02:00
add_header Cache-Control "public, max-age=7200";
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
add_header Referrer-Policy "no-referrer" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Download-Options "noopen" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Permitted-Cross-Domain-Policies "none" always;
add_header X-Robots-Tag "none" always;
add_header X-XSS-Protection "1; mode=block" always;
2017-05-02 14:22:18 +02:00
access_log off;
}
location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ {
2018-12-10 13:39:26 +01:00
try_files $uri /index.php$request_uri;
2017-05-02 14:22:18 +02:00
access_log off;
}
}