Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Varnish achieve page jump     - Oracle database NUMBER (x, y) data types (Database)

- curl Usage: Being the first site header and status codes (Server)

- Zabbix monitoring Oracle Database use Orabbix plug (Enhanced Edition) (Database)

- Oracle Linux 5.5 (64bit) Install Oracle 11gR2 RAC detailed tutorial (Database)

- Java object serialization and deserialization (Programming)

- MongoDB Learning the notes (Database)

- OpenSUSE installation on CentOS6 (GUI) (Linux)

- Linux using TCP-Wrapper Service Management (Linux)

- Ubuntu 14.04 configure JDK1.8.0_25, switchable version (Linux)

- How to choose the first programming language based on the life you want (Programming)

- Proper use Core Data multithreaded 3 ways (Programming)

- How to install Zephyr Test Management Tools on CentOS 7.x (Server)

- C ++ constant definition (Programming)

- JavaScript function part (Programming)

- MySQL replication master and slave structure built (Database)

- Four levels to deal with Linux server attacks (Linux)

- Ubuntu 14.04 How to set up an SSH without password (Linux)

- Radius server setup under CentOS (Server)

- LAN Deployment Docker-- from scratch to create your own private warehouse Docker (Linux)

- What have we learn from the front-end application Nodejs (Programming)

 
         
  Varnish achieve page jump
     
  Add Date : 2017-08-31      
         
         
         
  Ngxin implement user-agent to access the page without very simple, but we usually tip the cache layer, the layer of how to achieve in the cache, the same principles.

Today, with Varnish realize, notice that we realize that 302 redirect instead rewrite url

Goals: iphone to access www.abc.com will automatically jump to m.abc.com

Paste the code

sub vcl_recv {
 
   if (req.http.user-agent ~ "iphone") {
       if (req.http.host ~ "www.abc.com") {
           error 750 "m.abc.com";
     }
   }
}
 
sub vcl_error {
  if (obj.status == 750) {
     if (obj.response ~ "m.abc.com") {
         set obj.http.Location = "http://m.abc.com/";
}
     set obj.status = 302;
         return (deliver);
  }
}
     
         
         
         
  More:      
 
- OpenGL Superb Learning Notes - Vertex Shader example (Programming)
- Use matplotlib scientific drawing in Linux (Linux)
- Debian (Wheezy) Install Java environment / replace OpenJDK as the SUN JDK (Linux)
- 10 Nginx safety tips (Linux)
- Add your own kernel and ramfs based on an existing Linux LiveCD (Linux)
- CentOS 6.5 makes the LAN http source (Linux)
- Grading defense against Linux server attacks (Linux)
- 5 fast Node.js application performance tips (Programming)
- Iptables principle (Linux)
- CentOS 6.5 configuration SSDB 1.8.0 (Server)
- Arduino UNO simulation development environment set up and run simulation (Linux)
- Via Twitter how open source library to be used anywhere Emoji emoticons (Linux)
- C language binary tree counts words (Programming)
- SSH port forwarding application (Server)
- PULL operation mechanism parsing XML Comments (Programming)
- How to install the Linux text editor Atom 0.124.0 (Linux)
- Physical structure and process disk IO (Linux)
- Ubuntu install driver manager Mint Driver Manager and Device Driver Manager (Linux)
- Firewall Configuration Red Hat Enterprise Linux 4 (Linux)
- Export error: ORA-04063: package body dmsys dbms dm model exp has error (Database)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.