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原始协议
    }
    }

  • 相关阅读:
    MySQL查询出错提示 --secure-file-priv解决方法
    导入csv文件到mysql
    Ubuntu16.04配置phpmyadmin
    TensorFlow安装(Ubuntu 16.04)
    github设置只识别指定类型的文件
    python file operations
    Ubuntu16.04 install flash plugin
    PRML读书笔记——3 Linear Models for Regression
    Ubuntu下查看机器信息
    PRML读书笔记——2 Probability Distributions
  • 原文地址:https://www.cnblogs.com/yunian139/p/11811155.html
Copyright © 2011-2022 走看看