我有带有登陆页面 (Elementor) 的外部网站,例如 https://new.domain.com/landing。
但是某些静态内容(.js)无法加载,并且通过 NGINX 登陆网页无法正常工作。
如何正确配置 NGINX 以 proxy_pass 到使用 Cloudflare 远程静态内容的外部登录页面?
我尝试将 NGINX 与代理传递一起使用,如下所示:
location /custom/newpage {
proxy_pass https://new.domain.com/landing;
proxy_set_header Host new.domain.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Accept-Encoding "";
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
proxy_ssl_session_reuse off;
proxy_ssl_server_name on;
我使用了 Cloudflare,通过在 Cloudflare 管理面板中添加页面规则解决了问题。