zoukankan      html  css  js  c++  java
  • nginx部署客户端网站

    nginx1.9.9 配置文件如下

    http {
        include       mime.types;
        default_type  application/octet-stream;
        sendfile        on;
        #tcp_nopush     on;
        #keepalive_timeout  0;
        keepalive_timeout  65;
        #gzip  on;
    
        server {
            listen       80;
            server_name  localhost;
            client_max_body_size 10m;
            index index.html index.htm;
            # 允许跨域请求的域,*代表所有
            add_header 'Access-Control-Allow-Origin' *;
            # 允许带上cookie请求
            add_header 'Access-Control-Allow-Credentials' 'true';
            # 允许请求的方法,比如 GET/POST/PUT/DELETE
            add_header 'Access-Control-Allow-Method' *;
            # 允许请求的header
            add_header 'Access-Control-Allow-Headers' *;
            #access_log  logs/host.access.log  main;
            location ~ .(json|ttf|json|gif|htm|html|swf|js|css|jpg|jpeg|png|bmp|ico|wma|wmv|asf|mp3|mmf|zip|rar|flv|md|txt|apk|xls|wav|eot|woff|mp4)$ {
                #静态网页地址
                root /home/dist;
                index index.html;
            }
    
            location ~ ^/$
            {
                 #静态网页地址
                 root /home/dist;
            }
            location / { 
                proxy_pass http://10.156.104.213:8733/;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Real-Port $remote_port;
                #静态网页首页地址
                index /home/dist/index.html;
            }
           
            #error_page  404              /404.html;
    
            # redirect server error pages to the static page /50x.html
            #
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
    }
  • 相关阅读:
    2015百度之星 放盘子
    2015百度之星 IP聚合
    2015百度之星 列变位法解密
    2015百度之星 大搬家
    数论 --- 费马小定理 + 快速幂 HDU 4704 Sum
    组合数(Lucas定理) + 快速幂 --- HDU 5226 Tom and matrix
    Linux
    概率论 --- Uva 11181 Probability|Given
    JAVA
    网络爬虫-原理篇(二)
  • 原文地址:https://www.cnblogs.com/banma/p/14421705.html
Copyright © 2011-2022 走看看