This repository has been archived by the owner on Dec 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
76c2c0f
commit e67b5e2
Showing
9 changed files
with
307 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule chamberlain
updated
from 92a5c7 to 038b5f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
serverAddr = "clan.svrgn.app" | ||
serverPort = 7000 | ||
|
||
[[proxies]] | ||
name = "mint-http" | ||
type = "http" | ||
localPort = 8080 | ||
httpUser = "$FRP_USER" | ||
httpPassword = "$FRP_PASSWORD" | ||
customDomains = ["$CLAN_NAME.clan.svrgn.app"] | ||
|
||
[[proxies]] | ||
name = "mint-https" | ||
type = "https" | ||
localPort = 8443 | ||
customDomains = ["$CLAN_NAME.clan.svrgn.app"] | ||
|
||
[[proxies]] | ||
name = "mgmt-http" | ||
type = "http" | ||
localPort = 8080 | ||
httpUser = "$FRP_USER" | ||
httpPassword = "$FRP_PASSWORD" | ||
customDomains = ["$CLAN_NAME.clanmgmt.svrgn.app"] | ||
|
||
[[proxies]] | ||
name = "mgmt-https" | ||
type = "https" | ||
localPort = 8443 | ||
customDomains = ["$CLAN_NAME.clanmgmt.svrgn.app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
config-dir = /root/data/letsencrypt | ||
logs-dir = /root/data/letsencrypt/logs | ||
work-dir = /root/data/letsencrypt/work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
events { | ||
worker_connections 1024; # Example setting | ||
} | ||
|
||
http { | ||
# HTTP-to-HTTPS Redirection Server | ||
server { | ||
listen 8080; | ||
server_name $CLAN_NAME.clan.svrgn.app $CLAN_NAME.clanmgmt.svrgn.app; | ||
|
||
# Redirect all HTTP requests to HTTPS | ||
location / { | ||
return 301 https://$host$request_uri; | ||
} | ||
|
||
# Serve Certbot's ACME challenge for certificate renewal | ||
location /.well-known/acme-challenge/ { | ||
root /var/www/certbot; | ||
} | ||
} | ||
|
||
# HTTPS Server for HTTP Service | ||
server { | ||
listen 8443 ssl http2; | ||
server_name $CLAN_NAME.clan.svrgn.app; | ||
|
||
# SSL certificate paths | ||
ssl_certificate /root/data/letsencrypt/live/$CLAN_NAME.clan.svrgn.app/fullchain.pem; | ||
ssl_certificate_key /root/data/letsencrypt/live/$CLAN_NAME.clan.svrgn.app/privkey.pem; | ||
|
||
# Proxy HTTP requests to the local HTTP server on port 3338 | ||
location / { | ||
proxy_pass http://localhost:3338; | ||
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 Server for gRPC Service | ||
server { | ||
listen 8443 ssl http2; | ||
server_name $CLAN_NAME.clanmgmt.svrgn.app; | ||
|
||
# SSL certificate paths | ||
ssl_certificate /root/data/letsencrypt/live/$CLAN_NAME.clanmgmt.svrgn.app/fullchain.pem; | ||
ssl_certificate_key /root/data/letsencrypt/live/$CLAN_NAME.clanmgmt.svrgn.app/privkey.pem; | ||
|
||
# Enable gRPC proxying | ||
location / { | ||
grpc_pass grpc://localhost:3339; | ||
error_page 502 = /error502grpc; | ||
|
||
# gRPC-specific headers | ||
grpc_set_header Host $host; | ||
grpc_set_header X-Real-IP $remote_addr; | ||
grpc_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
grpc_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
# Custom 502 page to handle gRPC errors | ||
location = /error502grpc { | ||
internal; | ||
default_type application/grpc; | ||
add_header grpc-status 14; | ||
add_header content-length 0; | ||
return 204; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
events { | ||
worker_connections 1024; # Example setting | ||
} | ||
|
||
http { | ||
server { | ||
listen 8080; | ||
server_name $CLAN_NAME.clan.svrgn.app $CLAN_NAME.clanmgmt.svrgn.app; | ||
|
||
# Serve Certbot's ACME challenge for certificate renewal | ||
location /.well-known/acme-challenge/ { | ||
root /var/www/certbot; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.