Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering NGINX

You're reading from   Mastering NGINX Personalize, customize and configure NGINX to meet the needs of your server

Arrow left icon
Product type Paperback
Published in Jul 2016
Publisher
ISBN-13 9781782173311
Length 320 pages
Edition 2nd Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Dimitri Aivaliotis Dimitri Aivaliotis
Author Profile Icon Dimitri Aivaliotis
Dimitri Aivaliotis
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Installing NGINX and Third-Party Modules FREE CHAPTER 2. A Configuration Guide 3. Using the mail Module 4. NGINX as a Reverse Proxy 5. Reverse Proxy Advanced Topics 6. The NGINX HTTP Server 7. NGINX for the Application Developer 8. Integrating Lua with NGINX 9. Troubleshooting Techniques A. Directive Reference
B. The Rewrite Rule Guide C. The NGINX Community D. Persisting Solaris Network Tunings
Index

Legacy servers with cookies

You may find yourself in a situation where you will need to place multiple legacy applications behind one common endpoint. The legacy applications were written for a case where they were the only servers talking directly with the client. They set cookies from their own domain, and assumed that they would always be reachable via the / URI. In placing a new endpoint in front of these servers, these assumptions no longer hold true. The following configuration will rewrite the cookie domain and path to match that of the new application endpoint:

server {

  server_name app.example.com;

  location /legacy1 {

    proxy_cookie_domain legacy1.example.com app.example.com;

    proxy_cookie_path $uri /legacy1$uri;

    proxy_redirect default;

    proxy_pass http://legacy1.example.com/;
  }

Tip

The value of the $uri variable already includes the beginning slash (/), so it is not necessary to duplicate it here.

  location /legacy2 {

    proxy_cookie_domain legacy2.example...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $24.99/month. Cancel anytime