// DevOps

Embedding site-builder pages into your site via NGINX

Published on 2025-10-12

Integrating a page created in an external website builder into your domain allows you to extend functionality and maintain a consistent interface style. This article explains how to use an NGINX reverse proxy to embed pages from an external service (for example, example.website-builder.com) into your site your-main-site.com at paths /path1/ and /path2/.


⚙️ How it works

NGINX forwards requests from your domain to the external site, acting as an intermediary between the user and the builder service.

Example:

  • /path1/ → displays the page https://example.website-builder.com/partners
  • /path2/ → displays the page https://example.website-builder.com/

The user remains on your domain (your-main-site.com), while the external content is loaded through the proxy.


🧩 Key configuration elements

ComponentPurpose
proxy_passForwards requests to the external resource
proxy_set_headerPasses original headers and client IP
proxy_redirectRewrites URLs and links
proxy_cookie_domain / proxy_cookie_pathChanges cookie domain and path
proxy_buffers, timeoutsPerformance and memory settings

📜 NGINX configuration

server {
    listen 443 ssl;
    server_name your-main-site.com;

    # SSL-сертификаты
    ssl_certificate     /path/to/your/certificate.crt;
    ssl_certificate_key /path/to/your/private.key;

    # ---------- /path1/ ----------
    location /path1/ {
        proxy_pass https://example.website-builder.com/partners;
        proxy_http_version 1.1;
        proxy_set_header Connection "";

        proxy_set_header Host example.website-builder.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 X-Forwarded-Host  $host;
        proxy_ssl_server_name on;

        proxy_redirect off;
        proxy_redirect https://example.website-builder.com/partners /path1/;

        proxy_cookie_domain example.website-builder.com your-main-site.com;
        proxy_cookie_path   / /path1/;

        proxy_connect_timeout   5s;
        proxy_send_timeout     30s;
        proxy_read_timeout     30s;
        proxy_buffers           32 16k;
        proxy_busy_buffers_size 32k;
        client_max_body_size    20m;
    }

    # ---------- /path2/ ----------
    location /path2/ {
        proxy_pass https://example.website-builder.com/;
        proxy_http_version 1.1;
        proxy_set_header Connection "";

        proxy_set_header Host example.website-builder.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 X-Forwarded-Host  $host;
        proxy_ssl_server_name on;

        proxy_redirect off;
        proxy_redirect https://example.website-builder.com/ /path2/;
        proxy_redirect http://example.website-builder.com/ /path2/;

        proxy_cookie_domain example.website-builder.com your-main-site.com;
        proxy_cookie_path   / /path2/;

        proxy_connect_timeout   5s;
        proxy_send_timeout     30s;
        proxy_read_timeout     30s;
        proxy_buffers           32 16k;
        proxy_busy_buffers_size 32k;
        client_max_body_size    20m;
    }
}

🚀 Implementation steps

1. Preparation

  • Make sure NGINX is installed.
  • You have administrator privileges and a valid SSL certificate for your-main-site.com.
  • Check the availability of the external resource example.website-builder.com.

2. Adding the configuration

Create the file:

sudo nano /etc/nginx/conf.d/website_builder.conf

Paste the block above and save the changes.

3. Check and reload

sudo nginx -t
sudo systemctl reload nginx

4. Testing

Open:

Verify that pages, links, and cookies load correctly.


🧠 Recommendations

AreaAdvice
SecurityUse HTTPS on both ends, configure Content-Security-Policy, X-Frame-Options headers.
PerformanceTune timeouts, enable caching (proxy_cache), and optimize buffer sizes.
MonitoringEnable access_log and error_log for traffic analysis.
URL compatibilityVerify all relative links are correct after proxying.

🧩 Common issues and solutions

ProblemPossible solution
404 Not FoundCheck the correctness of proxy_pass and the availability of the external site.
Redirect loopsEnsure proxy_redirect does not conflict with external redirects.
Cookies not preservedConfigure proxy_cookie_domain and proxy_cookie_path correctly.
Mixed contentAll resources must be loaded over HTTPS.
Slow responsesIncrease timeouts or optimize the external server.

✅ Conclusion

Setting up a reverse proxy with NGINX lets you embed pages from a website builder into your domain while preserving a unified interface and style. This integration:

  • creates a seamless user experience;
  • simplifies deploying external landing pages or partner pages;
  • increases security and control over content.

By following the steps above, you can integrate an external site into your project in minutes, without complex logic or additional code.

// Reviews

Related reviews

// Contact

Need help?

Get in touch with me and I'll help solve the problem