作者归档:admin
nextcloud 去除 index.php 32.0.5版本可以用
PHP8.1版本 在conf目录里找到enable-php-81.conf 加入,
location ~ [^/]\.php(/|$)
{
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi-81.sock;
fastcgi_index index.php;
include fastcgi.conf;
include pathinfo.conf;
fastcgi_param front_controller_active true;
}
nginx conf mine.types 加入
application/javascript mjs;
nginx 网站配置文件加入
- location ~ ^/.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}location ~ ^/.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}location /.well-known {
rewrite ^/.well-known/webfinger /index.php/.well-known/webfinger last;
rewrite ^/.well-known/nodeinfo /index.php/.well-known/nodeinfo last;
rewrite ^/.well-known/(.*)$ /index.php/.well-known/$1 last;
}# 处理 Nextcloud 的 ocm-provider 和 ocs-provider
location ^~ /ocm-provider/ {
try_files $uri $uri/ /index.php$request_uri;
}location ^~ /ocs-provider/ {
try_files $uri $uri/ /index.php$request_uri;
}
#webdav和其他所有请求重定向到index.php上
location / {
rewrite ^ /index.php$uri;
rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
}
#静态资源重定向
location ~* \.(?:png|html|ttf|ico|jpg|jpeg)$ {
try_files $uri /index.php$uri$is_args$args;
access_log off;
}
location ~ ^/(?:updater|ocs-provider)(?:$|/) {
try_files $uri/ =404;
index index.php;
}
#安全设置,禁止访问部分敏感内容
location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
deny all;
}
location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) {
deny all;
}
location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
deny all;
}
location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) {
try_files $uri/ =404;
index index.php;
}
# Adding the cache control header for js, css and map files
# Make sure it is BELOW the PHP block
location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
try_files $uri /index.php$request_uri;
add_header Cache-Control “public, max-age=15778463”;
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;
# Optional: Don’t log access to assets
access_log off;
}
location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap|mp4|webm)$ {
try_files $uri /index.php$request_uri;
# Optional: Don’t log access to other assets
access_log off;
}
#mjs报错
location ~* \.mjs$ {
types { application/javascript mjs; }
try_files $uri =404;
}
# WASM
location ~* \.wasm$ {
types {
application/wasm wasm;
}
add_header Content-Type application/wasm;
expires 7d;
access_log off;
}
# otf
location ~* \.otf$ {
types {
application/x-font-otf otf;
font/opentype otf;
}
add_header Access-Control-Allow-Origin *;
expires 30d;
access_log off;
}
NGINX 配置 — Nextcloud 最新管理手册 最新文档
https://docs.nextcloud.com/server/32/admin_manual/installation/nginx.html
nextcloud宝塔面板nginx伪静态-去除index.php
修改宝塔PHP配置文件<font color=red>【非常重要,必须要改,否则不生效!!!】</font>
- 路径:
/www/server/nginx/conf - 文件名:
enable-php-74.conf根据所使用php版本修改相对应文件 -
location ~ [^/]\.php(/|$) { try_files $uri =404; fastcgi_pass unix:/tmp/php-cgi-74.sock; fastcgi_index index.php; include fastcgi.conf; include pathinfo.conf; }在配置文件最后一行加上
fastcgi_param front_controller_active true;
location ~ [^/]\.php(/|$)
{
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi-74.sock;
fastcgi_index index.php;
include fastcgi.conf;
include pathinfo.conf;
fastcgi_param front_controller_active true;
}
添加nginx伪静态规则和一些其它安全配置
- 在宝塔面板的伪静态页面添加,也可直接在配置文件里面添加
-
#(可选)添加如下header主要为了安全 add_header Strict-Transport-Security "max-age=63072000;"; #解析caldav和carddav rewrite /.well-known/carddav /remote.php/dav permanent; rewrite /.well-known/caldav /remote.php/dav permanent; #静态资源重定向1 location ~* \/core\/(?:js\/oc\.js|preview\.png).*$ { rewrite ^ /index.php last; } #webdav和其他所有请求重定向到index.php上 location / { rewrite ^ /index.php$uri; rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect; rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect; rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect; rewrite ^(/core/doc/[^\/]+/)$ $1/index.html; #静态资源重定向2,支持使用acme脚本在申请证书时对域名的验证 if ($uri !~* (?:\.(?:css|js|svg|gif|png|html|ttf|woff)$|^\/(?:remote|public|cron|status|ocs\/v1|ocs\/v2)\.php|^\/\.well-known\/acme-challenge\/.*$)){ rewrite ^ /index.php last; } } #静态资源重定向3 location ~* \.(?:png|html|ttf|ico|jpg|jpeg)$ { try_files $uri /index.php$uri$is_args$args; access_log off; } location ~ ^/(?:updater|ocs-provider)(?:$|/) { try_files $uri/ =404; index index.php; } #caldav和carddav rewrite /.well-known/carddav /remote.php/dav permanent; rewrite /.well-known/caldav /remote.php/dav permanent; # Remove X-Powered-By, which is an information leak fastcgi_hide_header X-Powered-By; location = /robots.txt { allow all; log_not_found off; access_log off; } #(可选)为了支持user_webfinger app rewrite ^/.well-known/host-meta /public.php?service=host-meta last; rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last; #支持日历和联系人,建议加上 location = /.well-known/carddav { return 301 $scheme://$host:$server_port/remote.php/dav; } location = /.well-known/caldav { return 301 $scheme://$host:$server_port/remote.php/dav; } #启动Gzip,不要删除ETag headers gzip on; gzip_vary on; gzip_comp_level 4; gzip_min_length 256; gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; #安全设置,禁止访问部分敏感内容 location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ { deny all; } location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) { deny all; } location ~ ^/(data|config|\.ht|db_structure\.xml|README) { deny all; } location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) { try_files $uri/ =404; index index.php; } #这部分吧,默认就有,不过有所不同,所以我合并了下,替换原来的就行 location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/) { fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; set $path_info $fastcgi_path_info; try_files $fastcgi_script_name =404; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $path_info; fastcgi_param HTTPS on; fastcgi_pass unix:/tmp/php-cgi-74.sock; # Avoid sending the security headers twice fastcgi_param modHeadersAvailable true; # Enable pretty urls fastcgi_param front_controller_active true; fastcgi_intercept_errors on; fastcgi_request_buffering off; } # Adding the cache control header for js, css and map files # Make sure it is BELOW the PHP block location ~ \.(?:css|js|woff2?|svg|gif|map)$ { try_files $uri /index.php$request_uri; add_header Cache-Control "public, max-age=15778463"; 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; # Optional: Don't log access to assets access_log off; } location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap|mp4|webm)$ { try_files $uri /index.php$request_uri; # Optional: Don't log access to other assets access_log off; }
v2ray
安装设置 v2_ray.fun 面板
wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/v2_ray.fun/master/install.sh && bash install.sh
安装过程输入 账号 – 密码 – 端口号 即可,访问面板通过 ip+port,更改面板配置信息,直接ssh连上去命令行界面输入 v2_ray。
访问v2面板:
修改任意端口及websocket协议,修改传输协议为 WebSocket 时会提示输入域名,输入添加解析的域名 v2_ray.xxx.com。

再编辑 /etc/v2_ray/config.json 文件,指定 path路径 /ws/

指定 v2_ray 走nginx的代理
在网站配置文件或nginx的配置文件中添加:
location /ws {
proxy_redirect off;
proxy_pass http://127.0.0.1:10010;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
重启nginx和v2_ray服务
nginx可通过可视化界面点击重启;
service v2_ray restart
Frp 服务端一键配置脚本安装和配置指南
步骤 1: 下载安装脚本
首先,使用 wget 命令下载 frps-onekey 安装脚本:
wget https://raw.githubusercontent.com/mvscode/frps-onekey/master/install-frps.sh -O /install-frps.sh
步骤 2: 赋予脚本执行权限
下载完成后,赋予脚本执行权限:
chmod 700 /install-frps.sh
步骤 3: 运行安装脚本
运行安装脚本以开始安装 Frp 服务端:
./install-frps.sh install
步骤 4: 配置 Frp 服务端
安装过程中,脚本会提示你输入一些配置信息,如监听端口、Token 等。根据提示输入相应的配置信息。
步骤 5: 启动 Frp 服务端
安装完成后,Frp 服务端会自动启动。你可以使用以下命令管理 Frp 服务端:
/etc/init.d/frps [start|stop|restart|status|config|version]
其他操作
卸载 Frp 服务端:
./install-frps.sh uninstall
更新 Frp 服务端:
./install-frps.sh update
通过以上步骤,你可以轻松地在服务器上安装和配置 Frp 服务端,实现内网穿透功能。
————————————————
frps-onekeyFrps 一键安装脚本&管理脚本 项目地址: https://gitcode.com/gh_mirrors/fr/frps-onekey
无线传输公平性 Airtime Fairness
Airtime Fairness(发送时间公平性)技术是一种用于优化无线局域网性能的技术,特别是在多客户端环境下,能够提高整个网络的传输效率和公平性。该技术通过调整各个客户端的服务时间,确保高性能设备在需要时能够获得更多的传输机会,从而提升整体网络的传输速度和等待时间
1
2
。
工作原理
在传统的无线局域网中,接入点(AP)在同一时间内只能与一个客户端通信。当多个客户端同时接入时,速度较慢的设备会占用更多的时间,导致整体网络效率下降。Airtime Fairness技术通过动态调整每个客户端的服务时间,确保高性能设备在慢速设备完成后获得更多的传输机会。具体来说,当慢速设备完成传输后,剩余的时间会被分配给高性能设备,从而提高整体网络的传输性能
1
2
。
优缺点
优点:
提高传输效率:通过优化服务时间分配,高性能设备能够更快地完成传输,提升整体网络的传输速度和效率
1
2
。
减少等待时间:减少了客户端的等待时间,提升了用户体验
1
2
。
缺点:
影响慢速设备:虽然提高了整体网络的性能,但可能会使慢速设备的传输速度变得更慢,因为它们的服务时间被转移到高性能设备上
1
2
。
应用场景
Airtime Fairness技术特别适用于以下场景:
家庭和多用户环境:在家庭或小型办公环境中,多个设备同时连接时,该技术能够有效提升网络的整体性能和公平性
1
2
。
高流量环境:在网络流量较大的环境中,该技术能够帮助平衡不同设备的传输需求,避免单个设备占用过多资源
网件R7000 夜莺,梅林固件
ubnutu netdata 安装
bash <(curl -Ss https://my-netdata.io/kickstart-static64.sh)
或者
sudo apt-get install netdata
访问:http://<your-server-ip>:19999
开始安装没有启动,或者只能本地访问,需要更改配置文件,/etc/netdata/netdata.conf 127.0.0.1 的地址改成,0.0.0.0
NetData的基本操作
# 启动NetData服务,并设置开机启动
sudo systemctl enable netdata
sudo systemctl start netdata
# 重启服务
sudo systemctl restart netdata
# 停止NetData服务
sudo systemctl stop netdata
intel-s1400fp4 主板详接 插针介绍
fstab中每个字段代表的含义
fstab全称为file system table,即文件系统表。它在开机的时候告诉系统挂载哪些分区、挂载点是什么、以什么格式挂载、挂载的选项等等。系统在开机的时候会根据fstab内容,执行挂载操作。
UUID=your UUID /data ext4 defaults 0 2
或
/dev/nvme0n1 /data ext4 defaults 0 0
第一列可以是实际分区名,也可以是实际分区的uuid,如果磁盘是SATA(Serial Advanced Technology Attachment)接口,且有多个磁盘,则每个磁盘被标记为 /dev/hda 、 /dev/hdb、 /dev/hdc 等以此类推;而每个磁盘的分区被标记为 /dev/hda1、 /dev/hda2等。
如果磁盘是SCSI(Small Computer System Interface,小型计算机系统接口)类型,则多个磁盘会被分别标记为 /dev/sda、/dev/sdb等等。
我的是nvme磁盘, 是 Non-Volatile Memory Express 的缩写,意思是非易失性内存快速通道。
第二列为磁盘分区的挂载目录,可以通过df -TH命令查询。挂载点必须为当前已经存在的目录,为了兼容起见,最好在创建需要挂载的目标目录后,将其权限设置为777,以开放所有权限。
第三列为磁盘分区的文件系统格式, 可以通过df -TH命令查询。
第四列为磁盘分区的挂载选项,此处通常设置为defaults即可。
第五列为Linux dump备份选项。
0表示不使用Linux dump备份。现在通常不使用dump备份,此处设置为0即可。
1表示使用Linux dump备份。
第六列为fsck选项,即开机时是否使用fsck检查磁盘。
0表示不检验。
挂载点为(/)根目录的分区,此处必须填写1。
根分区设置为1,其他分区只能从2开始


