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

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

云服務器|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

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 亚洲 欧美 中文 日韩 另类 | www.久久99| 禁漫H天堂免费A漫 | 男人的天堂在线观看免费 | 先锋资源av| 深夜福利影院在线观看 | chinese踩踏调教vk | 久久久久综合 | 天天操丝袜 | 亚洲va在线va天堂va偷拍 | 日本欧美强乱视频在线 | 99re精品在线 | 三年片韩国在线观看 | 亚洲国产视频网站 | 四虎综合九九色九九综合色 | 国产欧美久久久精品影院 | 色多多影院 | 日本一区二区三区在线 观看网站 | 精品美女国产互换人妻 | 色老板视频在线观看 | 热99精品只有里视频最新 | 韩剧网3600热播剧 | 国产在线乱子伦一区二区 | 美女张开腿黄网站免费精品动漫 | 国产精品天天看特色大片不卡 | 精品国产一二三区在线影院 | 四虎4hu永久免费国产精品 | aaa在线| 美女和男人一起差差 | 国内自拍网红在综合图区 | 风间由美m3u8在线 | 午夜香蕉| japanese秘书丝袜 | 香蕉eeww99国产精品 | 火影小南被爆羞羞网站 | 亚洲AV无码一区二区三区乱子伦 | 日韩精品视频在线播放 | 午夜福利在线观看6080 | 香蕉免费一区二区三区在线观看 | 2020国语对白露脸 | 男女做受快插大片 |