iis迁移到nginx_从Nginx迁移到特使代理

本文介绍了如何将Web服务器从IIS平滑迁移到Nginx,包括迁移过程的关键步骤和比较优势。
摘要由CSDN通过智能技术生成

iis迁移到nginx

介绍 (Introduction)

In this article I would like to touch on the topic of migrating NGINX configuration to ENVOY, because my Kubernetes, which is currently in dev environment, and uses Nginx Ingress Controller, and I wanted to switch to Envoy if Envoy had advantages over Nginx and was easy to migrate.

在本文中,我想谈谈将NGINX配置迁移到ENVOY的主题,因为我的Kubernetes(目前处于开发环境中,并且使用Nginx Ingress Controller),并且如果Envoy比Nginx更具优势,并且我想使用Engin,我想切换到Envoy。易于迁移。

In katacoda there is simple scenario for this,

在katacoda中,有一个简单的方案,

从NGINX迁移到Envoy (Migrating from NGINX to Envoy)

This scenario is intended to support the migration from NGINX to Envoy. This will help you apply your previous experience and understanding of NGINX to Envoy.

此方案旨在支持从NGINX到Envoy的迁移。 这将帮助您将以前对NGINX的经验和理解应用于Envoy。

We learn:

我们学习:

  • Configure Envoy server configuration and settings

    配置Envoy服务器配置和设置
  • Configure Envoy to proxy traffic to external services.

    配置Envoy以将流量代理到外部服务。
  • Set AccessLog and ErrorLog.

    设置AccessLog和ErrorLog。

At the end of the scenario, you’ll learn about the core features of Envoy and how to migrate your existing NGINX scripts to the platform.

在场景的最后,您将了解Envoy的核心功能以及如何将现有的NGINX脚本迁移到平台。

NGINX示例配置 (NGINX Example Configuration)

user  www www;
pid /var/run/nginx.pid;
worker_processes  2;


events {
  worker_connections   2000;
}


http {
  gzip on;
  gzip_min_length  1100;
  gzip_buffers     48k;
  gzip_types       text/plain;


  log_format main      '$remote_addr - $remote_user [$time_local]  '
    '"$request" $status $bytes_sent '
    '"$http_referer" "$http_user_agent" '
    '"$gzip_ratio"';


  log_format download  '$remote_addr - $remote_user [$time_local]  '
    '"$request" $status $bytes_sent '
    '"$http_referer" "$http_user_agent" '
    '"$http_range" "$sent_http_content_range"';




  upstream targetCluster {
    172.22.0.5:80;
    172.22.0.6:80;
  }}


  server {
    listen        8080;
    server_name   sample.mars.com  www.sample.mars.com;


    access_log   /var/log/nginx.access_log  main;
    error_log  /var/log/nginx.error_log  info;


    location / {
      proxy_pass         http://targetCluster/;
      proxy_redirect     off;


      proxy_set_header   Host             $host;
      proxy_set_header   X-Real-IP        $remote_addr;
    }
  }
}

NGINX configuration usually has three main components.

NGINX配置通常包含三个主要组件。

  1. NGINX server, logging structure, Gzip feature configuration. It is defined globally across all instances.

    NGINX服务器,日志记录结构,Gzip功能配置。 它在所有实例中全局定义。
  2. Configure NGINX to accept requests from the one.example.com host on port 8080.

    将NGINX配置为在端口8080上接受来自one.example.com主机的请求。
  3. Configure the target location for how to handle traffic to different parts of the URL.

    配置目标位置,以了解如何处理URL的不同部分的流量。

Not all configurations apply to the Envoy Proxy and you do not need to configure any particular aspect. Envoy Proxy has four main components that support the core infrastructure provided by NGINX.

并非所有配置都适用于Envoy代理,并且您不需要配置任何特定方面。 Envoy代理具有四个主要组件,它们支持NGINX提供的核心基础结构。

  • Listeners: Defines how the Envoy Proxy accepts incoming requests. Currently, Envoy Proxy only supports TCP-based listeners. Once the connection is established, it is passed through a set of filters for processing.

    侦听器 :定义Envoy代理如何接受传入的请求。 当前,Envoy代理仅支持基于TCP的侦听器。 建立连接后,它将通过一组过滤器进行处理。

  • Filters: It is part of a pipeline architecture that can handle inbound and outbound data. This feature enables filters such as Gzip that compress the data bef

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值