Proxy ssl name (#148)

* Proxy ssl name
This commit is contained in:
Salah Al Saleh
2024-03-18 11:50:58 -07:00
committed by GitHub
parent 50ae487ea6
commit bd11003095
3 changed files with 15 additions and 22 deletions

View File

@@ -5,8 +5,3 @@ COPY nginx.conf /etc/nginx/nginx.conf
COPY src/favicon.ico /usr/share/nginx/html/
COPY src/index.htm /usr/share/nginx/html/
COPY src/ttlsh_files /usr/share/nginx/html/ttlsh_files/
ADD entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -1,7 +0,0 @@
#!/bin/sh
set -e
sed -i "s/__PORT__/$PORT/g" /etc/nginx/nginx.conf
exec "$@"

View File

@@ -3,9 +3,16 @@ http {
include mime.types;
default_type application/octet-stream;
proxy_ssl_server_name on;
resolver 8.8.8.8;
upstream upstream_ttlsh {
server ttlsh.herokuapp.com:443;
}
server {
listen __PORT__;
server_name router.ttl.sh;
listen <%= ENV["PORT"] %>;
server_name _;
location / {
root /usr/share/nginx/html;
@@ -18,15 +25,13 @@ http {
location /v2 {
client_max_body_size 10000m;
proxy_pass https://ttl.sh;
proxy_http_version 1.1;
proxy_request_buffering off;
proxy_intercept_errors on;
proxy_set_header Host $host;
set $upstream upstream_ttlsh;
proxy_pass https://$upstream;
proxy_ssl_name ttlsh.herokuapp.com;
proxy_set_header x-forwarded-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_set_header Host ttlsh.herokuapp.com;
proxy_request_buffering off;
}
}
}