博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
nginx 配置实例
阅读量:5042 次
发布时间:2019-06-12

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

nginx.conf

#user nobody;

worker_processes 1;

#error_log logs/error.log;

#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;
client_max_body_size 2000m;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';

#access_log logs/access.log main;

sendfile on;

#tcp_nopush on;

#keepalive_timeout 0;

keepalive_timeout 900;

#gzip on;

 

# another virtual host using mix of IP-, name-, and port-based configuration

#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;

# location / {

# root html;
# index index.html index.htm;
# }
#}

 

# HTTPS server

#
#server {
# listen 443 ssl;
# server_name localhost;

# ssl_certificate cert.pem;

# ssl_certificate_key cert.key;

# ssl_session_cache shared:SSL:1m;

# ssl_session_timeout 5m;

# ssl_ciphers HIGH:!aNULL:!MD5;

# ssl_prefer_server_ciphers on;

# location / {

# root html;
# index index.html index.htm;
# }
#}
include enabled/*.conf;
}

 

 

 

 

/enabled/gsup-test.glodon.com.conf

 

upstream gsup-test.glodon.com {

server 127.0.0.1:8080 weight=1 max_fails=2 fail_timeout=30s;
}

 

server {

listen 80;
server_name gsup-test.glodon.com;
access_log /opt/logs/gsup-test.glodon.com_access.log;

 

 

 

location / {

proxy_pass http://gsup-test.glodon.com;
client_body_buffer_size 128k;
client_max_body_size 500m;
proxy_buffers 4 32k;
proxy_buffer_size 4k;
proxy_busy_buffers_size 64k;
proxy_connect_timeout 90;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_read_timeout 90;
proxy_redirect off;
proxy_send_timeout 90;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_temp_file_write_size 64k;

 

}

 

}

 

转载于:https://www.cnblogs.com/lizhenjiang/p/7016146.html

你可能感兴趣的文章
NavigationBar设置
查看>>
IO端口和IO内存的区别及分别使用的函数接口
查看>>
夺命雷公狗---node.js---10之POST的接收
查看>>
自定义的JavaScript定时器
查看>>
smarty对数组进行json_encode
查看>>
Django model 字段类型及选项解析(二)
查看>>
《Linux命令行与shell脚本编程大全》第十四章 处理用户输入
查看>>
189. Rotate Array 从右边开始翻转数组
查看>>
用wget命令下载jdk
查看>>
python之路 Javascript的学习
查看>>
无法远程连接MySQL数据库服务器-(1130错误)
查看>>
C#读写Config配置文件
查看>>
k8s 核心功能 - 每天5分钟玩转 Docker 容器技术(116)
查看>>
LeetCode 简单 -旋转字符串(796)
查看>>
激活函数可视化
查看>>
雅虎的这个效果,有机会实现一下
查看>>
第五周学习进度情况
查看>>
【旧文章搬运】Windbg+Vmware驱动调试入门(四)---VirtualKD内核调试加速工具
查看>>
Linux GDB Debugging
查看>>
代码智能提示
查看>>