Older/Server/conf/nginx.conf

480 lines
17 KiB
Nginx Configuration File
Raw Normal View History

2023-07-21 16:17:01 +08:00
user root;
worker_processes 1;
2024-06-16 14:50:10 +08:00
error_log logs/error.log info;
2023-07-21 16:17:01 +08:00
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
rewrite_log on;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
2024-11-20 14:55:56 +08:00
gzip_types application/octet-stream text/markdown text/plain application/json application/x-javascript text/css application/xml text/javascript application/javascript application/x-httpd-php application/text image/jpeg image/gif image/png;
2024-08-13 22:21:40 +08:00
# 定义一个限流区域,名称为 one大小为 10MB限速为每 5 分钟 5 次请求
limit_req_zone $binary_remote_addr zone=one:10m rate=3r/m;
2024-06-16 14:50:10 +08:00
init_by_lua_file lua/initialize.lua;
2024-01-24 23:26:11 +08:00
upstream local {
server 127.0.0.1:8081;
2023-12-10 13:25:33 +08:00
}
2024-11-20 14:55:56 +08:00
upstream wt {
2024-01-24 23:26:11 +08:00
server 127.0.0.1:8082;
2023-07-21 16:17:01 +08:00
}
2024-11-20 14:55:56 +08:00
upstream twikoo {
server 127.0.0.1:8083;
}
2024-01-28 14:06:56 +08:00
upstream frp_http_proxy {
2024-01-24 23:26:11 +08:00
server 127.0.0.1:8084;
2023-07-21 16:17:01 +08:00
}
2024-01-28 14:06:56 +08:00
upstream frp_board {
2024-01-24 23:26:11 +08:00
server 127.0.0.1:8085;
2023-07-21 16:17:01 +08:00
}
2024-01-25 10:55:22 +08:00
upstream speed_test {
2024-01-24 23:26:11 +08:00
server 127.0.0.1:8087;
2023-11-21 00:10:26 +08:00
}
2024-05-31 22:47:31 +08:00
upstream frp_pve {
server 127.0.0.1:8088;
}
2024-11-20 14:55:56 +08:00
upstream meilisearch {
server 127.0.0.1:7700;
}
2024-02-18 15:06:19 +08:00
upstream typesense {
server 127.0.0.1:8108;
}
2024-06-16 14:50:10 +08:00
2024-01-28 14:06:56 +08:00
server {
listen 443 ssl;
server_name unraid.amass.fun;
client_header_timeout 120s;
client_body_timeout 120s;
client_max_body_size 512m; #上传文件最大支持512m
2024-01-28 14:06:56 +08:00
ssl_certificate cert/unraid.amass.fun.pem;
ssl_certificate_key cert/unraid.amass.fun.key;
ssl_session_timeout 5m; #缓存有效期
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #加密算法
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #安全链接可选的加密协议
ssl_prefer_server_ciphers on; #使用服务器端的首选算法
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-wiz-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://frp_http_proxy;
}
}
2024-05-31 22:47:31 +08:00
server {
listen 443 ssl;
server_name pve.amass.fun;
client_header_timeout 120s;
client_body_timeout 120s;
client_max_body_size 512m; #上传文件最大支持512m
ssl_certificate cert/pve.amass.fun.pem;
ssl_certificate_key cert/pve.amass.fun.key;
ssl_session_timeout 5m; #缓存有效期
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #加密算法
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #安全链接可选的加密协议
ssl_prefer_server_ciphers on; #使用服务器端的首选算法
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-wiz-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass https://frp_pve;
}
}
2023-12-17 14:36:22 +08:00
server {
listen 443 ssl;
2024-05-03 22:30:46 +08:00
server_name iot.amass.fun;
2023-12-17 14:36:22 +08:00
client_header_timeout 120s;
client_body_timeout 120s;
2024-05-03 22:30:46 +08:00
ssl_certificate cert/iot.amass.fun.pem;
ssl_certificate_key cert/iot.amass.fun.key;
2023-12-17 14:36:22 +08:00
ssl_session_timeout 5m; #缓存有效期
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #加密算法
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #安全链接可选的加密协议
ssl_prefer_server_ciphers on; #使用服务器端的首选算法
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-wiz-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
2024-01-28 14:06:56 +08:00
proxy_pass http://frp_http_proxy;
2023-12-17 14:36:22 +08:00
}
}
2024-09-16 17:17:45 +08:00
server {
listen 443 ssl;
server_name code.amass.fun;
client_header_timeout 120s;
client_body_timeout 120s;
ssl_certificate cert/code.amass.fun.pem;
ssl_certificate_key cert/code.amass.fun.key;
ssl_session_timeout 5m; #缓存有效期
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #加密算法
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #安全链接可选的加密协议
ssl_prefer_server_ciphers on; #使用服务器端的首选算法
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-wiz-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://frp_http_proxy;
}
}
2024-06-02 23:32:41 +08:00
server {
listen 443 ssl;
server_name money.amass.fun;
client_header_timeout 120s;
client_body_timeout 120s;
ssl_certificate cert/money.amass.fun.pem;
ssl_certificate_key cert/money.amass.fun.key;
ssl_session_timeout 5m; #缓存有效期
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #加密算法
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #安全链接可选的加密协议
ssl_prefer_server_ciphers on; #使用服务器端的首选算法
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-wiz-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://frp_http_proxy;
}
}
server {
listen 443 ssl;
server_name money-mobile.amass.fun;
client_header_timeout 120s;
client_body_timeout 120s;
ssl_certificate cert/money-mobile.amass.fun.pem;
ssl_certificate_key cert/money-mobile.amass.fun.key;
ssl_session_timeout 5m; #缓存有效期
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #加密算法
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #安全链接可选的加密协议
ssl_prefer_server_ciphers on; #使用服务器端的首选算法
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-wiz-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://frp_http_proxy;
}
}
2024-10-08 23:04:35 +08:00
server {
listen 443 ssl;
server_name photos.amass.fun;
client_header_timeout 120s;
client_body_timeout 120s;
client_max_body_size 100m;
ssl_certificate cert/photos.amass.fun.pem;
ssl_certificate_key cert/photos.amass.fun.key;
ssl_session_timeout 5m; #缓存有效期
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #加密算法
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #安全链接可选的加密协议
ssl_prefer_server_ciphers on; #使用服务器端的首选算法
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-wiz-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://frp_http_proxy;
}
}
server {
listen 80;
server_name photos.amass.fun;
client_header_timeout 120s;
client_body_timeout 120s;
client_max_body_size 100m;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-wiz-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://frp_http_proxy;
}
}
server {
listen 443 ssl;
server_name reader.amass.fun;
client_header_timeout 120s;
client_body_timeout 120s;
client_max_body_size 100m;
ssl_certificate cert/reader.amass.fun.pem;
ssl_certificate_key cert/reader.amass.fun.key;
ssl_session_timeout 5m; #缓存有效期
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #加密算法
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #安全链接可选的加密协议
ssl_prefer_server_ciphers on; #使用服务器端的首选算法
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-wiz-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://frp_http_proxy;
}
}
2024-06-02 23:32:41 +08:00
server {
listen 443 ssl;
2024-09-16 17:17:45 +08:00
server_name home.amass.fun;
2024-06-02 23:32:41 +08:00
client_header_timeout 120s;
client_body_timeout 120s;
2024-09-16 17:17:45 +08:00
ssl_certificate cert/home.amass.fun.pem;
ssl_certificate_key cert/home.amass.fun.key;
2024-06-02 23:32:41 +08:00
ssl_session_timeout 5m; #缓存有效期
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #加密算法
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #安全链接可选的加密协议
ssl_prefer_server_ciphers on; #使用服务器端的首选算法
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-wiz-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://frp_http_proxy;
}
}
server {
listen 80;
2024-09-16 17:17:45 +08:00
server_name home.amass.fun;
rewrite ^(.*)$ https://home.amass.fun$1 permanent;
2024-06-02 23:32:41 +08:00
}
2023-11-21 00:10:26 +08:00
server {
2024-05-03 22:30:46 +08:00
listen 80;
server_name iot.amass.fun;
2023-11-21 00:10:26 +08:00
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-wiz-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2024-05-31 22:47:31 +08:00
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://frp_http_proxy;
}
}
server {
listen 443 ssl;
server_name next.amass.fun;
client_header_timeout 120s;
client_body_timeout 120s;
ssl_certificate cert/next.amass.fun.pem;
ssl_certificate_key cert/next.amass.fun.key;
ssl_session_timeout 5m; #缓存有效期
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #加密算法
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #安全链接可选的加密协议
ssl_prefer_server_ciphers on; #使用服务器端的首选算法
2024-06-16 14:50:10 +08:00
2024-05-31 22:47:31 +08:00
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-wiz-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2023-11-21 00:10:26 +08:00
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
2024-01-28 14:06:56 +08:00
proxy_pass http://frp_http_proxy;
# access_by_lua_file lua/authentication.lua;
2023-07-21 16:17:01 +08:00
}
}
2024-02-18 15:06:19 +08:00
server {
listen 443 ssl;
server_name typesense.amass.fun;
client_header_timeout 120s;
client_body_timeout 120s;
client_max_body_size 512m;
ssl_certificate cert/typesense.amass.fun.pem;
ssl_certificate_key cert/typesense.amass.fun.key;
ssl_session_timeout 5m; #缓存有效期
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #加密算法
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #安全链接可选的加密协议
ssl_prefer_server_ciphers on; #使用服务器端的首选算法
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://typesense;
}
}
2023-07-21 16:17:01 +08:00
server {
listen 443 ssl;
2023-11-21 00:10:26 +08:00
server_name amass.fun;
2023-11-05 19:01:15 +08:00
ssl_certificate cert/amass.fun.pem;
ssl_certificate_key cert/amass.fun.key;
include server.conf;
2023-07-21 16:17:01 +08:00
}
server {
listen 443 ssl;
server_name mirror.amass.fun;
ssl_certificate cert/mirror.amass.fun.pem;
ssl_certificate_key cert/mirror.amass.fun.key;
include server.conf;
2023-07-21 16:17:01 +08:00
}
server {
listen 80;
server_name amass.fun;
location /resources {
2023-07-21 16:17:01 +08:00
root .;
}
2023-11-18 18:08:16 +08:00
location /speedtest {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-wiz-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://speed_test;
}
location /backend {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-wiz-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://speed_test;
}
2023-07-21 16:17:01 +08:00
location / {
rewrite ^(.*)$ https://amass.fun$1 permanent;
}
}
2024-10-08 23:04:35 +08:00
server {
listen 80;
server_name mirror.amass.fun;
location /resources {
2024-10-08 23:04:35 +08:00
root .;
}
location /speedtest {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-wiz-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://speed_test;
}
location /backend {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-wiz-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://speed_test;
}
location / {
rewrite ^(.*)$ https://mirror.amass.fun$1 permanent;
}
}
2023-07-21 16:17:01 +08:00
}