Intranet interface call, SSH reverse tunnel and Nginx reverse proxy

Source: Internet
Author: User
Tags nginx reverse proxy

External network access test machine.

The Windows machine uses SSH to reverse tunnel. Service side using reverse proxy

    1. Install Openssh-win and set environment variables under win

    2. Open cmd

      C:\users\administrator>ssh-p 22-r 1999:localhost:8080-b 0.0.0.0 [email protected]

      -R 1999 Port of the remote machine

      -B External network segment monitoring, no 127.0.0.1 monitoring

      8080 Native port

      This way, the 1999 port of the extranet access 8.8.8.8 maps to LocalHost's 8080

    3. Server Nginx Reverse Proxy

VI nginx.conf

Upstream Dev {

Server 127.0.0.1:1999;

}

server {

Listen 80;

server_name dev.xx.com;

Location/{

Proxy_pass Http://dev;

}

Proxy_ignore_client_abort on;

Proxy_set_header Host $host;

Proxy_set_header X-real-ip $remote _addr;

Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;

}

4. dev.xx.com can access to localhost:8080

This article is from the "Quest" blog, please be sure to keep this source http://chenxy.blog.51cto.com/729966/1890459

Intranet interface call, SSH reverse tunnel and Nginx reverse proxy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.