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/;

    }

    }

  • 相关阅读:
    Java线程中带有返回值的线程Callable
    Android 子线程测试
    JAVA下的Thread.sleep方法一定要try
    解决Android Studio 和 Android SDK Manager 无法在线更新的问题.
    asp.net关于页面不回发,不生成__doPostBack方法问题的完美解决方案
    git 使用2
    前端vue组件传参
    微信小程序 路由跳转 异步请求 存储数据,微信登录接口
    微信小程序 基本介绍及组件
    安装虚拟机
  • 原文地址:https://www.cnblogs.com/ly-radiata/p/6196492.html
Copyright © 2011-2022 走看看