Last active
October 20, 2016 08:26
-
-
Save androzd/d18ba4eb694596aadbedd55b7958f3d1 to your computer and use it in GitHub Desktop.
NGINX server to localhost tunelling
This file contains hidden or 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
| Это нужно чтобы ловить webhook от различных сервисов на локаль, либо чтобы показать сайт заказчику. | |
| Что нужно: Сервер со статическим IP с настроенным NGINX, и localhost с установленным ssh | |
| Что получится в итоге: при открытии some.site.ru будет открыт дефолтный сервер на localhost |
This file contains hidden or 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
| upstream tunnel_name { | |
| server 127.0.0.1:3000; | |
| } | |
| server { | |
| listen 80; | |
| server_name some.site.ru; | |
| 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_name; | |
| } | |
| } |
This file contains hidden or 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
| ssh -vnNT -R 3000:localhost:80 login@site.ru |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment