zoukankan      html  css  js  c++  java
  • nginx

    just a simple example, for more information -> http://nginx.org/en/docs/.
    1.vi /etc/yum.repos.d/nginx.repo

    2. find repo from http://nginx.org/packages, choose version according to your system. save it.
    [nginx]
    name=nginx repo
    baseurl=http://nginx.org/packages/[OS(for example:centos)]/$releasever/$basearch/
    gpgcheck=0
    enabled=1

    3.yum install nginx

    (yum update)

    4.config nginx
    u can edit nginx.conf directly or use "include" in nginx.conf
    (1)root
    A location context can contain directives that define how to resolve a request – either serve a static file or pass the request to a proxied server.
    (2)proxy_pass
    The proxy_pass directive passes the request to the proxied server accessed with the configured URL. The response from the proxied server is then passed back to the client.
    (3)proxy_set_header (NGINX Reverse Proxy)
    By default, NGINX redefines two header fields in proxied requests, “Host” and “Connection”,
    and eliminates the header fields whose values are empty strings. “Host” is set to the $proxy_host variable, and “Connection” is set to close:
    proxy_set_header Host $proxy_host;
    proxy_set_header Connection close;
    To change these setting, as well as modify other header fields, use the "proxy_set_header" directive.
    This directive can be specified in a location or higher.
    It can also be specified in a particular server context or in the http block

    server {
    listen 80;

    server_name www.system-in-motion.com;
    root [location context];

    location / {
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://127.0.0.1:8080/;

    }

    }

  • 相关阅读:
    Ruby入门——简介&基本概述
    Ruby入门——数组
    测试之路——现阶段&下一阶段
    Ruby入门——环境准备
    Ruby入门——哈希表
    Linux常用命令<按字母排序...>之D,E,F
    多态界面的子控件控制
    随笔
    多态界面的数据显示
    app开发快速理解——webview网页显示
  • 原文地址:https://www.cnblogs.com/ly-radiata/p/6196492.html
Copyright © 2011-2022 走看看