Skip to content

Commit

Permalink
Proxy ssl name (#148)
Browse files Browse the repository at this point in the history
* Proxy ssl name
  • Loading branch information
sgalsaleh authored Mar 18, 2024
1 parent 50ae487 commit bd11003
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
5 changes: 0 additions & 5 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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;"]
7 changes: 0 additions & 7 deletions nginx/entrypoint.sh

This file was deleted.

25 changes: 15 additions & 10 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
}
}

0 comments on commit bd11003

Please sign in to comment.