Back to Blog

إعداد بروكسي عكسي على Google Cloud

في Google Cloud Platform (GCP)، يعتبر البروكسي العكسي (Reverse Proxy) حجر الزاوية لأي تطبيق قابل للتوسع. سواء كنت تستخدم خدمة Cloud Load Balancing المدارة بالكامل أو تفضل إعداد Nginx بنفسك، الهدف واحد: الأداء والأمان.

الخيار الأول: Cloud Load Balancing

هذا هو الخيار "السحابي" الأصلي. يعمل كبروكسي عكسي عالمي (Global Anycast IP).

  • يدعم إنهاء SSL (SSL Termination) تلقائياً.
  • يتكامل مع Cloud CDN لتخزين المحتوى مؤقتاً.
  • يحمي من هجمات DDoS عبر Cloud Armor.

الخيار الثاني: Nginx على Compute Engine

إذا كنت بحاجة لتحكم دقيق (مثلاً: قواعد إعادة كتابة معقدة أو وحدات Lua)، فإن نشر Nginx هو الحل.


# إعداد Nginx كبروكسي لخدمة Cloud Run
server {
    listen 80;
    server_name myapp.com;

    location / {
        proxy_pass https://my-cloud-run-service-xyz.a.run.app;
        proxy_set_header Host my-cloud-run-service-xyz.a.run.app;
        proxy_set_header X-Real-IP $remote_addr;
    }
}
                    

Disclosure: we may earn a commission if you purchase through some links.

Services Related To This Article

These offers are related to privacy, password security, and development workflows. Replace the current links with your real affiliate links through environment variables.

Default Links Need Replacement

Proton

Privacy, mail, and VPN

A strong fit for privacy-focused visitors who want VPN and secure email under one brand.

Explore Proton

Surfshark

Consumer VPN

Best on pages about geo-blocking, privacy, and public Wi-Fi protection.

Try Surfshark

NordVPN

High-converting VPN

A clear offer for users who need a paid, more durable alternative to a free proxy.

View NordVPN

1Password

Password management

The best match for password, secrets, team access, and personal security pages.

Discover 1Password

DigitalOcean

Developer cloud hosting

A strong fit for proxy setup, server, and infrastructure content aimed at developers and small teams.

Start with DigitalOcean