Browse Source

添加nginx示例配置

heavyrian2012 2 years ago
parent
commit
572f57a1df
2 changed files with 28 additions and 0 deletions
  1. 1 0
      build_release.sh
  2. 27 0
      nginx/appserver.conf

+ 1 - 0
build_release.sh

@@ -8,6 +8,7 @@ mvn clean package
 cd target
 cp -af ../config ./
 cp -af ../systemd ./
+cp -af ../nginx ./
 cp -af ../release_note.md ./
 tar -czvf app-server-release-$1.tar.gz app-$1.jar config systemd release_note.md
 cp app-server-release-$1.tar.gz app-server-release-latest.tar.gz

+ 27 - 0
nginx/appserver.conf

@@ -0,0 +1,27 @@
+server {  
+        listen 80;
+        server_name apptest.wildfirechat.cn;
+        rewrite ^(.*)$  https://apptest.wildfirechat.cn permanent;      
+        location ~ / {
+            index index.html index.php index.htm;
+        }
+}
+
+server {
+        listen 443 ssl;
+        server_name apptest.wildfirechat.cn;
+
+        root html;
+        index index.html index.htm;
+        client_max_body_size        30m; #文件最大大小
+        ssl_certificate   cert/app.pem;
+        ssl_certificate_key  cert/app.key;
+        ssl_session_timeout 5m;
+        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
+        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
+        ssl_prefer_server_ciphers on;
+        ## send request back to app server ##
+        location / {
+            proxy_pass http://127.0.0.1:8888; 
+        }
+}