博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
nginx普通配置/负载均衡配置/ssl/https配置
阅读量:5156 次
发布时间:2019-06-13

本文共 2261 字,大约阅读时间需要 7 分钟。

1、nginx普通配置server {    listen       80;    server_name  jqlin.lynch.com;    access_log  /var/log/nginx/main.log  main;    error_log   /var/log/nginx/pay_local.error;    #log_format access '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent $request_body "$http_referer" "$http_user_agent" $http_x_forwarded_for';    client_max_body_size 60M;    client_body_buffer_size 512k;     location /apidoc {        alias  /usr/share/nginx/html/apidoc;        index  index.html;    }    location / {        proxy_pass http://172.16.92.255:8091; # 172.16.92.255为局域网IP,不行用localhost/127.0.0.1替代           proxy_redirect  off;        proxy_set_header Host $host;        proxy_set_header X-Real-IP $remote_addr;        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;        }     }2、nginx负载均衡配置upstream mysite {    server 172.16.92.255:8092 weight=5; # 172.16.92.255为局域网IP,不行用localhost/127.0.0.1替代       server 172.16.92.255:8091 weight=5; # 172.16.92.255为局域网IP,不行用localhost/127.0.0.1替代   } server {    listen 80;    server_name jqlin.lynch.com www.jqlin.lynch.com;    access_log  /var/log/nginx/main.log  main;    error_log   /var/log/nginx/pay_local.error;    client_max_body_size 60M;    client_body_buffer_size 512k;    location /apidoc {        alias  /usr/share/nginx/html/apidoc;        index  index.html;    }            location / {        proxy_pass http://mysite;    }}3、nginx ssl/https配置server {    listen       80;    server_name www.jqlin.lynch.com jqlin.lynch.com;    error_log   /usr/share/nginx/html/test/pay_local.error;    client_max_body_size 60M;    client_body_buffer_size 512k;        location / {           root   /usr/share/nginx/html/kshop;        index  index.html;        autoindex  on;    }    }server {    listen       443    ssl;    server_name www.jqlin.lynch.com jqlin.lynch.com;    error_log   /usr/share/nginx/html/test/pay_local.error;    client_max_body_size 60M;    client_body_buffer_size 512k;        location / {                root   /usr/share/nginx/html/kshop;                index  index.html;                autoindex  on;    }        ssl_certificate /etc/nginx/conf.d/fullchain.pem;    ssl_certificate_key /etc/nginx/conf.d/privkey.pem;}

 

转载于:https://www.cnblogs.com/linjiqin/p/10679331.html

你可能感兴趣的文章
js编码
查看>>
Pycharm Error loading package list:Status: 403错误解决方法
查看>>
steps/train_sat.sh
查看>>
转:Linux设备树(Device Tree)机制
查看>>
iOS 组件化
查看>>
(转)Tomcat 8 安装和配置、优化
查看>>
(转)Linxu磁盘体系知识介绍及磁盘介绍
查看>>
tkinter布局
查看>>
命令ord
查看>>
Sharepoint 2013搜索服务配置总结(实战)
查看>>
博客盈利请先考虑这七点
查看>>
使用 XMLBeans 进行编程
查看>>
写接口请求类型为get或post的时,参数定义的几种方式,如何用注解(原创)--雷锋...
查看>>
【OpenJ_Bailian - 2287】Tian Ji -- The Horse Racing (贪心)
查看>>
Java网络编程--socket服务器端与客户端讲解
查看>>
List_统计输入数值的各种值
查看>>
学习笔记-KMP算法
查看>>
Timer-triggered memory-to-memory DMA transfer demonstrator
查看>>
跨域问题整理
查看>>
[Linux]文件浏览
查看>>