Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
upstream tunnel {
upstream tunnel2 {
server {
listen 443;
server_name *;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://tunnel;
ssl on;
ssl_certificate /etc/letsencrypt/live/; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/; # managed by Certbot
server {
if ($host = {
return 301 https://$host$request_uri;
} # managed by Certbot
#Included in amazon ec2 - Linux ami free
#Create ssh keypair amazon:
$ adduser usera
#Enter in shell usera and 'keygen -y' in MyKeyPair.pem. Copy and paste to server.
#Change shell user:
vim /etc/passwd
#Install nginx and php-fpm:
Configuring tunnel bypass reverse with nginx:
file: /etc/nginx/conf.d/default.conf
#Create certs ssl certs - LetsCrypt (open source) with certbot
obs: remember to remove credentials from index.php when you first renew or create the certificates.
other solutions: websockets (wstunnel tool)!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.