worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 0;
gzip on;
gzip_min_length 1k;
gzip_buffers 16 64k;
gzip_http_version 1.1;
gzip_comp_level 6;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
server {
listen 443;
server_name api.example.com;
ssl on;
ssl_certificate server-key/server.pem;
ssl_certificate_key server-key/server.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!RC4:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!EXP:+MEDIUM;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://127.0.0.1:8888;
}
}
server {
listen 80;
server_name redirect.yunpian.easybao.com;
location / {
proxy_pass https://sms.yunpian.com;
}
}
server {
listen 80;
server_name redirect.yunpianvoice.example.com;
location / {
proxy_pass https://voice.yunpian.com;
}
}
server {
listen 443;
server_name redirect.hs.easybao.com;
location / {
proxy_pass https://vopen.hscloud.cn;
}
}
server{
listen 80;
server_name redirect.umeng.example.com;
location / {
proxy_pass http://msg.umeng.com;
}
}
# Enable nginx status
server {
listen 55777;
location /nginx_status {
stub_status on;
access_log off;
#allow 127.0.0.1;
#allow 10.24.34.53; # Put your zabbix_mon zabbix monitoring server here
#deny all;
}
}
}
stream {
upstream backend {
server 122.224.243.187:1567 max_fails=3 fail_timeout=30s;
}
server {
listen 1567;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass backend;
}
}
NGINX-配置例子01
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 大家好,我是IT修真院成都分院第7期的JAVA学员龚剑飞,一枚正直纯洁善良的java程序员。 今天给大家分享一下,...