admin-ui ng转发域名增加
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
# WebSocket connection upgrade
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
# HTTPS 分流:主域名/www 走 115.227.17.84,其他二级域名走 116.204.74.41
|
||||
map $host $https_upstream {
|
||||
default http://116.204.74.41;
|
||||
redpowerfuture.com http://115.227.17.84;
|
||||
www.redpowerfuture.com http://115.227.17.84;
|
||||
}
|
||||
|
||||
# HTTP - 反代到 115.227.17.84(生产前端)
|
||||
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;
|
||||
|
||||
location / {
|
||||
proxy_pass $https_upstream/;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
# 非 redpowerfuture.com 的 HTTP 请求转发
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user