LogoLogo
MerchantsHelpSign in
  • Overview
    • Countries & Currencies
    • Glopal Solutions Portfolio
  • Getting started
    • Shopify
      • Glopal Duty & Tax for Shopify
      • Shopify Collaborator Access
    • BigCommerce
    • Magento (Adobe Commerce)
      • Magento 1
      • Magento 2
        • Magento Activation
        • Magento Configuration
        • Magento Database Model
    • Visualsoft
    • PrestaShop
  • Marketing Solutions
    • Acquisition channels
      • Integrate Google Ads
      • Integrate Facebook Ads
    • Feed localization
      • Read domestic items
      • Localize the items
      • Upload the localized items
    • Features / Customization
      • Google Shopping countries coverage
      • Filters
      • Free listings
      • Comparison Shopping Services (CSS)
    • Google Ads
      • Conversion tracking
      • Standard accounts structure
      • Launching and monitoring Google Ads campaigns
    • Facebook
      • Facebook & Instagram Shops
      • Catalog Based Campaigns
      • Conversion and Brand awareness campaigns
      • Facebook conversion tracking
    • Email marketing
  • Localization
    • Site localization
      • Content localization
      • Price localization
      • Site search
      • Checkout
      • User account
    • Site discovery
      • Domains and Routing
      • Search engine optimization
      • Geo-localization
      • Country selector
    • Content distribution
      • Site security
      • Domains (DNS)
      • Traffic Splitting
        • Akamai
        • Cloudflare
        • Nginx
        • Microsoft IIS
        • AWS CloudFront
        • Magento Cloud
      • Third-party CDN
        • Cloudflare
      • Site speed
    • Integrations
      • CSS customizations
      • JavaScript customizations
      • Server-side customizations
      • Exclude from localization
      • Integration examples
        • Hiding Products
        • Newsletter Signup
        • Custom Price Logic
  • Checkout
    • Localized checkout
      • Overview
      • Styling
      • Integration
        • Callback Functions
        • Confirmation Page
        • Checkout Analytics
        • Allowlisting Glopal IPs
      • Price localization
    • Order processing
      • Order creation
        • Plug & Play integration
        • Order API
        • Event webhook
        • Custom Integration
      • Cancellation & refund
      • Returns
      • Buyer's communication
      • Customer account
    • Financials
      • EU VAT
  • DUTY & TAXES
    • Product Classification
    • Duty & Tax Calculation
      • Product Pricing
      • Supported Countries
    • Compliance Checks
      • Prohibited Goods
      • Denied Party Screening
  • SHIPPING
    • Order Creation
    • Label Generation
    • Manifest
    • Tracking
  • Translations
    • Translation Editor
  • MERCHANT ACCOUNT
    • Dashboards
      • SEO dashboard
  • What's New
    • Release Notes
Powered by GitBook
On this page
  • Dependencies
  • Create a rule
  • Testing your rule
  1. Localization
  2. Content distribution
  3. Traffic Splitting

Nginx

Setting up Traffic Splitting with Nginx

PreviousCloudflareNextMicrosoft IIS

Last updated 11 months ago

Dependencies

Most default installations of NGINX will have ngx_http_proxy_module already installed and running. To check for this you can run a simple command:

terminal
$ nginx -V 2>&1 | tr ' ' '\n' | grep 'ngx_http_proxy_module'

Provided you have got the expected output then you are ready to continue to “Create a rewrite rule” without any further intervention.

Proxy Module Missing

If the output from the above Nginx query is different from the above, then we can access the nginx.conf file typically located in /etc/nginx/ to validate that the module is loaded, and if not, add it in.

terminal
$ sudo nano /etc/nginx/nginx.conf

Insert at the top of the file:

/etc/nginx/nginx.conf
load_module "modules/ngx_http_proxy_module.so";

You can now test your configuration file for syntax errors:

terminal
$ sudo nginx -t

With no problems reported, restart Nginx to apply your changes:

terminal
$ sudo systemctl restart nginx

Create a rule

Insert the following into the configuration file for your domain.

Make sure to replace GLOPAL_HOSTNAME placeholder with the value you receive from Glopal (for example store-1234.app.glopalstore.com) and that PATTERN is a regular expression describing you want to delegate to Glopal:

/etc/sites-available/your-site.com.conf
http {
    # ...
    server {
        # ...
        location ~* ^/()($|[:/?]) {
           proxy_pass https://;
           proxy_set_header Host ;
           proxy_set_header X-Forwarded-Host $host;
           proxy_ssl_server_name on;
           proxy_ssl_protocols TLSv1.2 TLSv1.3;
        }
        # ...
    }
    # ...
}

You can now test your configuration file for syntax errors:

terminal
$ sudo nginx -t

With no problems reported, restart Nginx to apply your changes:

terminal
$ sudo systemctl restart nginx

Testing your rule

To ensure the rule works as expected, conduct a series of tests by visiting URLs that should be affected by the rule and confirming that they are rewritten correctly.

That's it! You have now created a URL rewrite rule in Nginx.

list of in-scope paths