博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux操作文档之nginx域名解析(一)
阅读量:6988 次
发布时间:2019-06-27

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

  hot3.png

创建 conf.d 文件夹,创建 xxx.conf 文件,并配置如下

server {	listen       80;	server_name  xxx.com;    //配置域名    access_log  /log/nginx/ad.v.stock.com.log  main;	    location ~ ^/aaa/bbb/(.*)$ {		alias /data/sc/plat/bbb/$1;		access_log on;       //设置日志输出		expires 24h;           //设置时间	}    location ~*.* {		proxy_pass http://localhost:28030;     //项目访问端口	}	        //设置请求头    proxy_set_header Host $host;    proxy_set_header X-Forwarded-Host $host;    proxy_set_header X-Forwarded-Server $host;    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;}

配置 nginx.conf

worker_processes  1;error_log  /log/nginx/error.log;events {    worker_connections  1024;}http {    include       mime.types;    default_type  application/octet-stream;    charset  utf-8;	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  /log/nginx/access.log  main;    server_names_hash_bucket_size 256;	client_header_buffer_size 4k;	large_client_header_buffers 4 8k;	client_body_buffer_size 256k;	client_max_body_size 8m;	client_header_timeout 3m;    client_body_timeout 3m;    send_timeout 3m;	open_file_cache max=20480 inactive=20s;	open_file_cache_valid 30s;	open_file_cache_min_uses 1;	keepalive_timeout  120;	tcp_nopush on;	sendfile on;	tcp_nodelay on;	gzip on;	gzip_min_length   1k;	gzip_buffers      8 64k;	gzip_http_version 1.0;	gzip_comp_level   2;	gzip_disable      "msie6";	gzip_types        text/plain application/x-javascript text/css application/xml;	gzip_vary on;		proxy_redirect off;	proxy_set_header X-Real-IP $remote_addr;	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;	proxy_set_header Host $host;		proxy_set_header referer $http_referer;	proxy_connect_timeout 60;	proxy_send_timeout 60;	proxy_read_timeout 60;	proxy_buffer_size 256k;	proxy_buffers 8 256k;	proxy_busy_buffers_size 256k;	proxy_temp_file_write_size 256k;	#limit_req_zone  $binary_remote_addr  zone=one:10m   rate=5r/s;	# Load config files from the /etc/nginx/conf.d directory	include conf.d/*.conf;}

转载于:https://my.oschina.net/Xangyu/blog/817965

你可能感兴趣的文章
it翘楚-兄弟连兄弟会
查看>>
超棒的CSS开源UI界面元素类库 - TopCat
查看>>
javaExecutors并发线程池ThreadPoolExecuto
查看>>
坦克大战源码
查看>>
不限量的快递查询接口-JAVA对接方法
查看>>
jib自定义entrypoint
查看>>
掌握Beyond Compare比较表格技巧
查看>>
图书资源下载网站推荐
查看>>
fastjson 总结
查看>>
Python Split函数的用法总结(持续更新中。。。)
查看>>
决心书
查看>>
介绍遍历子表的方法
查看>>
网络的分类
查看>>
PGSQL创建自增的id-- postgresql nextval 使用
查看>>
12python程序另一种运行方式
查看>>
Tomcat高级应用(添加虚拟主机及优化)
查看>>
Kindeditor(jsp)与SSH三大框架整合上传图片出错问题解决方案
查看>>
Mongodb基操--将复制集与节点选举玩弄于股掌之中
查看>>
SSM框架Spring+SpringMVC+MyBatis——详细整合教程
查看>>
winXP系统如何打开剪贴板查看器
查看>>