Question about proxy

Saint Michael venefax at gmail.com
Sun Jan 29 20:17:15 UTC 2023


In my website, I proxied
https://perplexity.ai
trough a domain of mine
but when I get redirected, I see on top, on the domain line, not my own line.
In other cases, I see my own domain line.
What causes each case, i.e., what do I need to do so always the
https://domain.com is NOT the original domain being proxied, but my
own domain (https://disney.ibm.com).

in this case, this is the example:

server {
default_type  application/octet-stream;
set $template_root /usr/local/openresty/nginx/html/templates;
listen 0.0.0:443 ssl;
# reuseport;
error_log logs/error.log warn;
access_log logs/access.log;
server_name  disney.ibm.com;
ssl_certificate /etc/letsencrypt/live/disney.ibm.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/disney.ibm.com/privkey.pem;
location / {
proxy_cookie_domain https://perplexity.ai https://disney.ibm.com;
proxy_buffering on;
resolver 127.0.0.1 ipv6=off;
proxy_http_version 1.1;
proxy_buffer_size  128k;
proxy_busy_buffers_size  256k;
proxy_buffers 4 256k;
proxy_set_header User-Agent $http_user_agent;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto   $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_set_header Accept-Encoding "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_ssl_server_name on;
proxy_ssl_name $proxy_host;
proxy_set_header Host perplexity.ai;
proxy_pass https://perplexity.ai;
proxy_redirect https://perplexity.ai https://disney.ibm.com;
subs_filter_types text/css text/javascript application/javascript;
subs_filter "https://cdn*.perplexity.ai/(.*)"
"https://disney.ibm.com/cdn*/$1" gi
subs_filter "https://perplexity.ai/(.*)" "https://disney.ibm.com/$1" gi;
subs_filter "https://(.*).perplexity.ai/(.*)" "https://disney.ibm.com/$1/$2" gi;
subs_filter "https://www.perplexity.ai" "https://disney.ibm.com" gi;
subs_filter "https://perplexity.ai" "https://disney.ibm.com" gi;
subs_filter "perplexity.ai" "disney.ibm.com" gi;
            }
    }


More information about the nginx mailing list