smoxy
English
English
  • Welcome to smoxy
  • Changelog
  • Support Contact
  • Migration of Load Balancers and Domains
  • Account
    • What is an Account?
    • Site Overview
      • Add a new domain
    • Origins & Loadbalancer
    • Domain Overview
      • SSL
    • DNS Overview
    • Team
    • IP Lists
    • Billing
  • Sites
    • What is a Site?
    • Dashboard
    • Page Rules
      • Page Rules - Use Cases
    • Conditional Rules
      • Conditional Rules - Use Cases
    • Image Optimization
    • Acceleration
    • Security
    • Basic Configuration
    • Redirect Sites
  • Developer Guide
    • GeoIP Headers (Request Metadata)
    • Cache Invalidation
    • Best Practices
      • Services Sites
      • Flush Tags
      • Test configuration options
      • Cache key configuration for images
    • Cloudflare Setup
    • Frameworks
      • Shopware 6
Powered by GitBook
On this page
  • Load balancing
  • Cache Control
  • Setting CORS Header and Access-Control-Allow-Origin

Was this helpful?

  1. Sites
  2. Page Rules

Page Rules - Use Cases

Last updated 7 months ago

Was this helpful?

Identifying use cases for page rules are difficult when you first start out with smoxy. This list should give you some ideas what is possible with conditional rules.

Load balancing

In smoxy you can define multiple load balancers pointing to different servers. You can use conditional rules to send the traffic to example.com/blog to a completely different server in a different hosting environment.

A similar set of configuration could be to route API requests to different versions of your API based on the URL path.

Cache Control

Do you have pages that should not be cached? This could be for example a checkout page in an online shop or an edit page of a personal profile.

Setting CORS Header and Access-Control-Allow-Origin

With smoxy, a Page Rule can be easily defined to automatically set this header.

Using a regex, for example, \.(woff|woff2|ttf)$, you can define to handle all requests for .woff, .woff2, and .ttf files with the new rule, and with the option HTTP Response Header and the text Access-Control-Allow-Origin=*, access from other websites to these files is finally allowed.

So, no configuration in the application or on the web server is necessary and can be set up easily with just a few clicks.

When content from a website is accessed from other domains, it's often necessary to set an Access-Control-Allow-Origin header. This is the case, for example, when JavaScript code provided by the domain is loaded via XMLHttpRequest from . The same applies to fonts defined in CSS and loaded from another domain.

https://example-a.com
https://example-b.com