一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務器之家:專注于服務器技術及軟件下載分享
分類導航

云服務器|WEB服務器|FTP服務器|郵件服務器|虛擬主機|服務器安全|DNS服務器|服務器知識|Nginx|IIS|Tomcat|

服務器之家 - 服務器技術 - Nginx - Nginx進行域名重寫和泛域名解析配置的方法

Nginx進行域名重寫和泛域名解析配置的方法

2020-01-12 16:12妖月風 Nginx

這篇文章主要介紹了Nginx進行域名重寫和泛域名解析配置的方法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧

本文介紹了Nginx進行域名重寫和泛域名解析配置的方法,分享給大家,具體如下:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#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;
 
 #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 65;
 
 #gzip on;
 
 #設置允許發布內容為8M
 client_max_body_size 20M;
 client_body_buffer_size 512k;
 
 add_header Access-Control-Allow-Origin *;
 add_header Access-Control-Allow-Headers X-Requested-With;
 add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
 
 server {
 listen  80;
 server_name www.xxx.com;
 location / {
 proxy_pass http://127.0.0.1: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;
 }
 }
 
 server {
 listen  80;
 server_name www.aaa.com;
 location / {
 proxy_pass http://127.0.0.1:9989;
 proxy_set_header Host $host;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 }
 }
 
 
 #泛域名解析
 server {
 listen  80;
 server_name *.web.yuyuyun.cn;
 location / {
 # 泛域名開始配置
 if ( $host ~* (.*)\.(.*)\.(.*)\.(.*) ) {
 set $domain $1; #獲取當前的 域名前綴
 }
 proxy_pass http://127.0.0.1:1119/$domain/;
 proxy_set_header Host $host;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 }
 
 }
 
}

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持服務器之家。

原文鏈接:https://blog.csdn.net/u010061060/article/details/54708796

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 大团圆免费阅读全文 | 边摸边吃奶边做爽gif动态图 | 日本视频二区 | 古代翁熄系小说辣文 | 国产成+人+综合+亚洲欧美丁香花 | 亚洲色图中文字幕 | 80日本xxxxxxxxx96 7个黑人玩北条麻妃 | 日韩视频在线观看中字 | 国产99视频精品免视看7 | 热门小说同人h改编h | 国产日韩精品一区二区三区 | 二次元美女内裤凹陷太深 | tobu8在线观看免费高清 | 国产一区二区三区水野朝阳 | 三级伦理影院 | 日韩免费一区 | 奇米影视在线视频8888 | 国产精品色爱综合网 | 国产精品合集久久久久青苹果 | 精品国产一级在线观看 | 欧美高清无砖专区欧美精品 | 亚裔maricahase和黑人 | 被黑人同学彻底征服全文小说阅读 | 99热99在线| 亚洲精品123区在线观看 | 九九久久国产精品大片 | 美女被灌浣肠失禁视频 | 免费一区视频 | 国产亚洲一区二区三区 | 日韩精品视频在线播放 | 国产xxxxxx久色视频在 | 美女被爆 | 日本视频免费在线观看 | 亚洲网站大全 | 免费日本在线视频 | 40分钟在线观看免费 | 乌克兰18sex性hd | 亚洲精品中文字幕久久久久久 | 欧美 亚洲 一区 | 欧美四级无删版影片 | chinese东北痞子gay |