wfansh 4 months ago
parent
commit
446bb158da
3 changed files with 80 additions and 0 deletions
  1. BIN
      conf/adweb_v3.sql.zip
  2. 63 0
      conf/nginx/adweb3.conf
  3. 17 0
      conf/nginx/general.conf

BIN
conf/adweb_v3.sql.zip


+ 63 - 0
conf/nginx/adweb3.conf

@@ -0,0 +1,63 @@
+map $http_upgrade $connection_upgrade {
+     default upgrade;
+     'websocket'      upgrade;
+}	
+
+server {
+	listen 80;
+	listen 443 ssl;
+	server_name v3.adwebcloud.com zhigeng.adwebcloud.com;
+	
+	# 日志地址
+	access_log  /var/log/nginx/access.log;
+	error_log /var/log/nginx/error.log;
+
+	ssl_certificate /root/.acme.sh/v3.adwebcloud.com_ecc/fullchain.cer;
+	ssl_certificate_key /root/.acme.sh/v3.adwebcloud.com_ecc/v3.adwebcloud.com.key;
+
+
+	include /etc/nginx/conf.d/adweb3/*.conf;
+
+	index index.html;
+	root /home/ubuntu/adweb3-web/dist; # 这里改成前端静态
+	location / {
+        try_files $uri $uri/ /index.html;
+
+        # 后端 API 的转发
+	location /adweb3/ {
+		proxy_set_header Upgrade $http_upgrade;
+                proxy_set_header Connection $connection_upgrade;
+        	proxy_pass http://127.0.0.1:8080;
+    	}
+
+	location /adweb3/websocket/ {
+		proxy_pass           http://127.0.0.1:8080/adweb3/websocket/;
+		proxy_http_version 1.1;
+		proxy_set_header Upgrade $http_upgrade;
+		proxy_set_header Connection "Upgrade";
+		proxy_set_header X-real-ip $remote_addr;
+		proxy_set_header X-Forwarded-For $remote_addr;
+	}
+
+
+    }
+	
+}	
+server {
+	listen 80;
+	server_name xxl-job.v3.adwebcloud.com;
+
+	# 日志地址
+	access_log  /var/log/nginx/access.log;
+	error_log /var/log/nginx/error.log;
+
+	location / {
+		# 后端 API 的转发
+		location / {
+			proxy_set_header Upgrade $http_upgrade;
+			proxy_set_header Connection $connection_upgrade;
+			proxy_pass http://127.0.0.1:8090;
+		}
+	}
+}
+

+ 17 - 0
conf/nginx/general.conf

@@ -0,0 +1,17 @@
+ ###gzip start
+gzip on;#开启gzip压缩
+gzip_min_length 1k;#设置最小压缩的页面大小,页面大小小于此值的话,不会被压缩。
+gzip_comp_level 9;#gzip压缩级别,范围从1(最快)到9(最慢和最优)
+gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;#指定哪些类型的响应内容需要被压缩
+gzip_vary on;#让Nginx发送 Vary: Accept-Encoding 头部,告诉代理响应是否根据请求头中的 Accept-Encoding 值变化
+gzip_disable "MSIE [1-6]\.";#某些低端浏览器不支持gzip功能,对齐关闭此功能
+gzip_proxied any;#无论请求是否经过代理服务器,都对其进行gzip压缩
+###gizp end
+
+###ssl param
+ssl_session_timeout 5m;
+ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
+ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
+ssl_prefer_server_ciphers on;
+keepalive_timeout 600;
+###ssl param