zoukankan      html  css  js  c++  java
  • nginx 配置文件配置(ssl和代理80端口)

    server {
    listen 80;
    server_name localhost;

    #charset koi8-r;

    #access_log logs/host.access.log main;

    # 将80端口的链接转发到8080端口

    location /guohang {
    proxy_pass http://localhost:8080;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_redirect default ;
    client_max_body_size 200m;
    }

    location / {
    root html;
    index index.html index.htm;
    }

    #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;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ .php$ {
    # proxy_pass http://127.0.0.1;
    #}

    }

    #ssl证书配置

    # HTTPS server
    #
    server {
    listen 443 ssl;
    server_name wechatguojihangyun.cn;  #ip绑定的域名
    ssl_certificate /usr/local/nginx/cert/domainName.pem;   #自定义证书位置
    ssl_certificate_key /usr/local/nginx/cert/domainName.key;  #自定义证书位置
    ssl_session_cache shared:SSL:1m; 
    ssl_session_timeout 5m;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;

    location / {
    proxy_pass http://127.0.0.1:8080;
    proxy_redirect http:// $scheme://;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Scheme $scheme;
    proxy_set_header WL-Proxy-SSL true; #weblogic启效,告诉weblogic原始协议
    proxy_set_header X-Forwarded-Proto https; #tomcat启效,告诉tomcat原始协议
    }
    }

  • 相关阅读:
    模拟赛20181101 雅礼 Wearry 施工 蔬菜 联盟
    模拟赛20181031 雅礼 Wearry 养花 折射 画作
    set/priority_queue的运算符重载
    set的完整用法
    最长公共上升子序列 O(n^2)
    无向图边双联通分量 tarjan 模板
    ID 迭代加深搜索 模板 埃及分数
    树上背包DP Luogu P2014 选课
    A* 第k短路
    [POJ3468]关于整数的简单题 (你想要的)树状数组区间修改区间查询
  • 原文地址:https://www.cnblogs.com/yunian139/p/11811155.html
Copyright © 2011-2022 走看看