common版本更新
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
node_modules
|
||||
.git
|
||||
.gitignore
|
||||
*.md
|
||||
dist
|
||||
.cache
|
||||
+73
-22
@@ -1,53 +1,110 @@
|
||||
# Nginx 静态文件服务 + 智能代理 + 自定义 404 页面
|
||||
|
||||
# Gitea 域名转发(HTTP)
|
||||
# 主站 HTTP → HTTPS 重定向
|
||||
server {
|
||||
listen 80;
|
||||
server_name redpowerfuture.com www.redpowerfuture.com;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
# Gitea HTTP → HTTPS 重定向
|
||||
server {
|
||||
listen 80;
|
||||
server_name gitea.redpowerfuture.com;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
# MinIO 域名转发(HTTP)
|
||||
# MinIO HTTP 直连(支持 HTTP/HTTPS 双协议)
|
||||
server {
|
||||
listen 80;
|
||||
server_name minio.redpowerfuture.com;
|
||||
return 301 https://$host$request_uri;
|
||||
location / {
|
||||
proxy_pass http://192.168.0.83:9000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
|
||||
# HTTP 重定向到 HTTPS(其他域名)
|
||||
# Consul HTTP(仅 HTTP)
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
return 301 https://$host$request_uri;
|
||||
server_name consul.redpowerfuture.com;
|
||||
location / {
|
||||
proxy_pass http://192.168.0.83:8500;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
|
||||
# MeiliSearch HTTP(仅 HTTP)
|
||||
server {
|
||||
listen 80;
|
||||
server_name meilisearch.redpowerfuture.com;
|
||||
location / {
|
||||
proxy_pass http://192.168.0.83:7700;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
# 项目管理 HTTP(仅 HTTP)
|
||||
server {
|
||||
listen 80;
|
||||
server_name pm.redpowerfuture.com;
|
||||
location / {
|
||||
proxy_pass http://192.168.0.83:8080;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
# jaeger HTTP(仅 HTTP)
|
||||
server {
|
||||
listen 80;
|
||||
server_name jaeger.redpowerfuture.com;
|
||||
location / {
|
||||
proxy_pass http://192.168.0.83:16686;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
# ==================== 主站 HTTPS(静态文件 + API 反向代理) ====================
|
||||
server {
|
||||
# 静态资源根目录(dist)
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
client_max_body_size 50M;
|
||||
|
||||
# SSL 配置
|
||||
listen 443 ssl;
|
||||
server_name redpowerfuture.com www.redpowerfuture.com;
|
||||
ssl_certificate /etc/nginx/ssl/scs1779764972146_redpowerfuture.com_server.crt;
|
||||
ssl_certificate_key /etc/nginx/ssl/scs1779764972146_redpowerfuture.com_server.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
# 自定义 404 页面,保持 404 状态码
|
||||
error_page 404 /404.html;
|
||||
|
||||
location = /404.html {
|
||||
internal;
|
||||
}
|
||||
|
||||
# 根路径默认进入网页端
|
||||
location = / {
|
||||
return 302 /web/index.html;
|
||||
}
|
||||
|
||||
# 兼容无斜杠访问
|
||||
location = /web {
|
||||
return 302 /web/;
|
||||
}
|
||||
@@ -56,32 +113,26 @@ server {
|
||||
return 302 /sys/;
|
||||
}
|
||||
|
||||
# 网页端(public/web/index.html -> dist/web/index.html)
|
||||
location /web/ {
|
||||
alias /usr/share/nginx/html/web/;
|
||||
try_files $uri $uri/ /web/index.html;
|
||||
}
|
||||
|
||||
# 后台管理端(dist/index.html,前缀 /sys/)
|
||||
location /sys/ {
|
||||
alias /usr/share/nginx/html/;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# 1. 先尝试作为静态文件查找
|
||||
location / {
|
||||
try_files $uri $uri/ @proxy;
|
||||
}
|
||||
|
||||
# 2. 无法找到的请求(API路径)代理到后端
|
||||
location @proxy {
|
||||
# 判断 URI 最后一段是否有扩展名
|
||||
# 有扩展名返回 404,无扩展名则代理
|
||||
if ($uri ~ \.[^./]+$) {
|
||||
return 404;
|
||||
}
|
||||
|
||||
proxy_pass http://116.204.74.41:8000;
|
||||
proxy_pass http://192.168.0.83:8000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
@@ -93,7 +144,7 @@ server {
|
||||
}
|
||||
}
|
||||
|
||||
# Gitea 域名转发(HTTPS)
|
||||
# ==================== Gitea HTTPS ====================
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name gitea.redpowerfuture.com;
|
||||
@@ -104,7 +155,7 @@ server {
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
location / {
|
||||
proxy_pass http://gitea.redpowerfuture.com:3000;
|
||||
proxy_pass http://192.168.0.83:3000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
@@ -116,7 +167,7 @@ server {
|
||||
}
|
||||
}
|
||||
|
||||
# MinIO 域名转发(HTTPS)
|
||||
# ==================== MinIO HTTPS ====================
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name minio.redpowerfuture.com;
|
||||
@@ -127,7 +178,7 @@ server {
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
location / {
|
||||
proxy_pass http://minio.redpowerfuture.com:9000;
|
||||
proxy_pass http://192.168.0.83:9000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
||||
Reference in New Issue
Block a user