admin-ui ng转发域名增加
This commit is contained in:
+73
-69
@@ -1,97 +1,101 @@
|
||||
# WebSocket connection upgrade
|
||||
# WebSocket 升级头透传:客户端带 Upgrade 头(WS 握手)时 Connection 置 upgrade,普通请求保持 close
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
# HTTP - 反代到 115.227.17.84(生产前端)
|
||||
# Gitea(gitea.animal-spot.icu → 3000)
|
||||
server {
|
||||
listen 80;
|
||||
server_name redpowerfuture.com *.redpowerfuture.com;
|
||||
client_max_body_size 500M;
|
||||
|
||||
location ^~ /
|
||||
{
|
||||
proxy_pass http://115.227.17.84;
|
||||
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 REMOTE-HOST $remote_addr;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_http_version 1.1;
|
||||
# proxy_hide_header Upgrade;
|
||||
|
||||
add_header X-Cache $upstream_cache_status;
|
||||
#Set Nginx Cache
|
||||
|
||||
set $static_filefFEkdMm2 0;
|
||||
if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
|
||||
{
|
||||
set $static_filefFEkdMm2 1;
|
||||
expires 1m;
|
||||
}
|
||||
if ( $static_filefFEkdMm2 = 0 )
|
||||
{
|
||||
add_header Cache-Control no-cache;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# HTTPS - 转发到 116.204.74.41
|
||||
server {
|
||||
listen 443 ssl default_server;
|
||||
server_name redpowerfuture.com *.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;
|
||||
|
||||
client_max_body_size 500M;
|
||||
server_name gitea.animal-spot.icu;
|
||||
client_max_body_size 1m;
|
||||
|
||||
location / {
|
||||
proxy_pass http://116.204.74.41;
|
||||
proxy_pass http://__API_HOST__:3000;
|
||||
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;
|
||||
proxy_connect_timeout 75s;
|
||||
proxy_send_timeout 86400s;
|
||||
proxy_read_timeout 86400s;
|
||||
# WebSocket 升级头透传
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_send_timeout 30s;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
}
|
||||
|
||||
# 非 redpowerfuture.com 的 HTTP 请求转发
|
||||
# Gitea HTTPS(证书覆盖 gitea.animal-spot.icu / www.gitea.animal-spot.icu)
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
client_max_body_size 500M;
|
||||
location ^~ /
|
||||
{
|
||||
proxy_pass http://115.227.17.84;
|
||||
listen 443 ssl;
|
||||
server_name gitea.animal-spot.icu;
|
||||
ssl_certificate /etc/nginx/ssl/gitea.animal-spot.icu.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/gitea.animal-spot.icu.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
client_max_body_size 1m;
|
||||
|
||||
location / {
|
||||
proxy_pass http://__API_HOST__:3000;
|
||||
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 REMOTE-HOST $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
# WebSocket 升级头透传
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_send_timeout 30s;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
}
|
||||
|
||||
# 顶级域名/HTTPS(证书覆盖 animal-spot.icu / www.animal-spot.icu)
|
||||
server {
|
||||
listen 443 ssl default_server;
|
||||
server_name animal-spot.icu www.animal-spot.icu;
|
||||
ssl_certificate /etc/nginx/ssl/animal-spot.icu.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/animal-spot.icu.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
client_max_body_size 1m;
|
||||
|
||||
location / {
|
||||
proxy_pass http://__API_HOST__:8080;
|
||||
proxy_http_version 1.1;
|
||||
# proxy_hide_header Upgrade;
|
||||
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;
|
||||
# WebSocket 升级头透传
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_send_timeout 30s;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
}
|
||||
|
||||
add_header X-Cache $upstream_cache_status;
|
||||
#Set Nginx Cache
|
||||
# 其余所有域名 → 项目管理(8080)
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
client_max_body_size 1m;
|
||||
|
||||
set $static_filefFEkdMm2 0;
|
||||
if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
|
||||
{
|
||||
set $static_filefFEkdMm2 1;
|
||||
expires 1m;
|
||||
}
|
||||
if ( $static_filefFEkdMm2 = 0 )
|
||||
{
|
||||
add_header Cache-Control no-cache;
|
||||
}
|
||||
location / {
|
||||
proxy_pass http://__API_HOST__: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;
|
||||
# WebSocket 升级头透传
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_send_timeout 30s;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user