Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Nginx Forword Proxy
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Nginx Forword Proxy

Hi
well i am a newbie to Nginx , but usually get things done in linux via Google , but wont able to find anything what i am trying to do ,

so i was trying to create a Nginx forward proxy .

Suppose , my country blocked the Youtube.com

defiantly we are using it via vpn or similar setup so nginx receive and foreword all traffic .

i want to make it accessible via

youtube.mydomain.com

is it even possible and if yes , can anyone post a sample config

thanks

Comments

  • hzrhzr Member

    no, use a proper vpn

    youtube serves traffic off way too many domains, videos are loaded off too many domains that vary

  • I bet you know shadowsocks

    and youtube isn't legal in some certain counties, don't do things silly :D

  • for every proxy or vpn solution , i need to setup on client side , the main purpose is client less or config less , dont know if its even possible , just asking

  • FrankZFrankZ Veteran
    edited October 2016

    I think you need to set up a reverse proxy to youtube.com, not a forward proxy.

    
        server {
           listen 80;
           server_name youtube.mydomain.com;
             location / {
                  proxy_pass https://www.youtube.com;
                  proxy_set_header       Host $host;
                  proxy_set_header X-Real-IP $remote_addr;
              }
         }
    

    EDIT: Ignore this, it did not work :(

  • edited October 2016

    You can use a iframe and a proxy browser will help to open youtube within the browser. You will need a script to get this done.

  • i tried reverse proxy already , and it didnt work
    well lets wait for more people's ideas maybe something will work,

    @FrankZ said:
    I think you need to set up a reverse proxy to youtube.com, not a forward proxy.

    > 
    >     server {
    >        listen 80;
    >        server_name youtube.mydomain.com;
    >          location / {
    >               proxy_pass https://www.youtube.com;
    >               proxy_set_header       Host $host;
    >               proxy_set_header X-Real-IP $remote_addr;
    >           }
    >      }
    > 

    EDIT: Ignore this, it did not work :(

  • Maybe using vinaget. This script a bit like rapidleech, but it works in a different way. Rapidleech can grab youtube video and store temporarily on your vps storage. While vinaget can grab youtube video without having to store the video on your vps storage
    (act as a "stream proxy" to target host).

  • Did you try Googling "nginx forward proxy"? Following is from the first result - https://ef.gy/using-nginx-as-a-proxy-server

    server {
        listen       8080;
    
        location / {
            resolver 8.8.8.8;
            proxy_pass http://$http_host$uri$is_args$args;
        }
    
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
    
  • save this trouble and set up a vpn, I recommend softether vpn or openvpn

  • Again this is something we will need to setup in our browsers or client for proxy .
    also people suggesting for vpn , i already have 3-4 vpns for different providers and they work well.
    its an idea of doing something different that's why asking you guys

    @jesin said:
    Did you try Googling "nginx forward proxy"? Following is from the first result - https://ef.gy/using-nginx-as-a-proxy-server

    server {
        listen       8080;
    
        location / {
            resolver 8.8.8.8;
            proxy_pass http://$http_host$uri$is_args$args;
        }
    
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
    
  • @stasi said:
    save this trouble and set up a vpn, I recommend softether vpn or openvpn

    Save yourself from VPN trouble and just use SSH tunnel.

  • hammad said: Again this is something we will need to setup in our browsers or client for proxy . also people suggesting for vpn , i already have 3-4 vpns for different providers and they work well. its an idea of doing something different that's why asking you guys

    So you're looking for a solution where you want to route traffic over a proxy without doing anything on the client system?

    If you install DD-WRT on your router and configure a GRE tunnel from the router to your VPS.

  • eKoeKo Member

    squid might do for your "forward proxy" idea. nginx isn't for that...squid is.

  • Or just set up a private webproxy for you and your friends?

  • Is it possible to forward all https links/connections/requests into http on nginx? I have a chat script that stop working when on https maybe because there are links/content in the script on http so they are blocked when accessing on http and chat stop loading.

Sign In or Register to comment.