zoukankan      html  css  js  c++  java
  • java-Linux-nginx_动静分离

    nginx.conf删除所有的注释项目变简单如下

    worker_processes  1;

    events {

        worker_connections  1024;

    }

    http {

        include       mime.types;

        default_type  application/octet-stream;

        sendfile        on;

        keepalive_timeout  65;

        server {

            listen       80;

            server_name  localhost;

            location / {

                root   html;

                index  index.html index.htm;

            }

            error_page   500 502 503 504  /50x.html;

            location = /50x.html {

                root   html;

            }

        }

    }

    server节点中增加一个访问规则

    location ~ .*.action$ {

    proxy_pass http://192.168.88.87:8080;

    #以内4行复制粘贴就可以

    proxy_redirect off;

    proxy_set_header Host $host;#可以让后端拿到真实的客户端ip地址

    proxy_set_header X-Real-IP $remote_addr;

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    }

  • 相关阅读:
    10.C# 构造函数
    9.C# 类
    8.C#友元程序集----可访问性相关
    7.C# 多态的实现
    4.C#虚方法virtual详解
    3.C#的访问权限修饰符
    2.静态类成员、静态构造函数、静态类
    1.面向对象的基本概念
    6.C# 释放非托管资源2
    原生js实现轮播图原理
  • 原文地址:https://www.cnblogs.com/sheying/p/8391011.html
Copyright © 2011-2022 走看看