nginx: add NextCloud configuration
parent
0e59acfd8a
commit
8f540ea80a
|
@ -1,49 +1,104 @@
|
||||||
worker_processes 1;
|
worker_processes 1;
|
||||||
|
|
||||||
events {
|
events {
|
||||||
worker_connections 1024;
|
worker_connections 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
http {
|
http {
|
||||||
include mime.types;
|
include mime.types;
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
sendfile on;
|
sendfile on;
|
||||||
keepalive_timeout 65;
|
keepalive_timeout 65;
|
||||||
gzip on;
|
gzip on;
|
||||||
charset utf-8;
|
charset utf-8;
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name heavenisin.space;
|
server_name heavenisin.space;
|
||||||
|
|
||||||
location /gopher/ {
|
include common.conf;
|
||||||
root /srv;
|
|
||||||
index index.html index.htm;
|
|
||||||
autoindex on;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
location /gopher/ {
|
||||||
root /srv/http/pub;
|
root /srv;
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
}
|
autoindex on;
|
||||||
|
}
|
||||||
|
|
||||||
error_page 500 502 503 504 /50x.html;
|
location / {
|
||||||
location = /50x.html {
|
root /srv/http/pub;
|
||||||
root /usr/share/nginx/html;
|
index index.html index.htm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name mu.heavenisin.space;
|
server_name mu.heavenisin.space;
|
||||||
|
|
||||||
location / {
|
include common.conf;
|
||||||
proxy_pass http://127.0.0.1:8000/;
|
|
||||||
}
|
|
||||||
|
|
||||||
error_page 500 502 503 504 /50x.html;
|
location / {
|
||||||
location = /50x.html {
|
proxy_pass http://127.0.0.1:8000/;
|
||||||
root /usr/share/nginx/html;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
upstream php-handler {
|
||||||
|
server unix:/run/php-fpm/php-fpm.sock;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 81;
|
||||||
|
listen [::]:81;
|
||||||
|
server_name rain;
|
||||||
|
root /usr/share/webapps/nextcloud/;
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
rewrite ^ /index.php$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||||
|
include fastcgi_params;
|
||||||
|
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 php-handler;
|
||||||
|
fastcgi_intercept_errors on;
|
||||||
|
fastcgi_request_buffering off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^/(?:updater|ocs-provider)(?:$|/) {
|
||||||
|
try_files $uri/ =404;
|
||||||
|
index index.php;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.(?:css|js|woff|svg|gif)$ {
|
||||||
|
try_files $uri /index.php$request_uri;
|
||||||
|
add_header Cache-Control "public, max-age=15778463";
|
||||||
|
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 ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
|
||||||
|
try_files $uri /index.php$request_uri;
|
||||||
|
# Optional: Don't log access to other assets
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue