Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy ssl name #148

Merged
merged 4 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}
}
Loading