N
N
nexus02020-06-30 09:10:29
Nginx
nexus0, 2020-06-30 09:10:29

Why can't I set up a reverse proxy for the site?

I want to set up a reverse proxy for the udemy.com site, something like a mirror. I am training on the local machine 192.168.56.103.
The site opens, but for some reason not all content is loaded.
The site also has subdomains about.udemy.com business.udemy.com. What to do with him? How to proxy them? Let's say the host 192.168.56.103 has its own domain host1.com. All poddmeny must be explicitly registered in the config, or can it be done somehow in a cunning way in the config?
5fadc67b4989006506847.png5efadc6cc55ba593679939.png
My config

[email protected]:/etc/nginx/sites-available# cat reverse-proxy.conf
server {
    listen 80;
    location / {
        proxy_pass https://www.udemy.com;
        proxy_set_header Accept-Encoding "";
        subs_filter "udemy.com" "192.168.56.103" gi;
        subs_filter "www.udemy.com" "192.168.56.103" gi;
        proxy_cookie_domain www.udemy.com 192.168.56.103;
        proxy_set_header Accept-Encoding "";
        proxy_ssl_server_name on;
        proxy_buffer_size   64k;
        proxy_buffers   4 64k;
        proxy_busy_buffers_size   64k;
    }
}

In nginx logs
2020/06/30 02:07:54 [error] 1043#1043: *6 connect() to [2606:4700::6810:5b34]:443 failed (101: Network is unreachable) while connecting to upstream, client: 192.168.56.1, server: , request: "GET /staticx/udemy/js/webpack/udlite-common-css.c95fd7689fd2991b5d6c.css HTTP/1.1", upstream: "https://[2606:4700::6810:5b34]:443/staticx/udemy/js/webpack/udlite-common-css.c95fd7689fd2991b5d6c.css", host: "192.168.56.103", referrer: "http://192.168.56.103/"
2020/06/30 02:07:54 [error] 1044#1044: *8 connect() to [2606:4700::6810:5c34]:443 failed (101: Network is unreachable) while connecting to upstream, client: 192.168.56.1, server: , request: "GET /staticx/udemy/js/webpack/discover.4f395c5d736d884d2124.css HTTP/1.1", upstream: "https://[2606:4700::6810:5c34]:443/staticx/udemy/js/webpack/discover.4f395c5d736d884d2124.css", host: "192.168.56.103", referrer: "http://192.168.56.103/"
2020/06/30 02:07:54 [error] 1044#1044: *8 connect() to [2606:4700::6810:5b34]:443 failed (101: Network is unreachable) while connecting to upstream, client: 192.168.56.1, server: , request: "GET /staticx/udemy/js/webpack/discover.4f395c5d736d884d2124.css HTTP/1.1", upstream: "https://[2606:4700::6810:5b34]:443/staticx/udemy/js/webpack/discover.4f395c5d736d884d2124.css", host: "192.168.56.103", referrer: "http://192.168.56.103/"
2020/06/30 02:07:54 [error] 1043#1043: *5 connect() to [2606:4700::6810:5c34]:443 failed (101: Network is unreachable) while connecting to upstream, client: 192.168.56.1, server: , request: "GET /staticx/udemy/js/webpack/home/desktop/hb.d6f43dc56be3016f6505.css HTTP/1.1", upstream: "https://[2606:4700::6810:5c34]:443/staticx/udemy/js/webpack/home/desktop/hb.d6f43dc56be3016f6505.css", host: "192.168.56.103", referrer: "http://192.168.56.103/"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2020-06-30
@q2digger

Separate domains are made virtual domains in the config

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question