Browse Source

改配置

李文 4 years ago
parent
commit
10fd419827
2 changed files with 20 additions and 14 deletions
  1. 17 11
      nginx.conf
  2. 3 3
      public/index.html

+ 17 - 11
nginx.conf

@@ -18,9 +18,9 @@ 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"';
+    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;
 
@@ -34,22 +34,28 @@ http {
 
     server {
         listen       80;
-        server_name  scocial-management-platform-frontend;
+        server_name  _;
 
         #charset koi8-r;
 
         #access_log  logs/host.access.log  main;
 
         location / {
-            root   html;
+            root   dist;
             index  index.html index.htm;
         }
-        location ^~/api/ {        
-			rewrite ^/api/(.*)$ /$1 break;        
-			proxy_set_header   Host             $host;        
-			proxy_set_header   x-forwarded-for  $remote_addr;        
-			proxy_set_header   X-Real-IP        $remote_addr;        
-			proxy_pass http://192.168.12.225:31903;
+        location /login {    
+        proxy_pass http://192.168.12.225:31903/login;
+        proxy_set_header   X-Forwarded-Proto $scheme;
+        proxy_set_header   Host              $http_host;
+        proxy_set_header   X-Real-IP         $remote_addr;
+		}
+
+        location /sys/menu/list {    
+        proxy_pass http://192.168.12.225:31903/sys/menu/list;
+        proxy_set_header   X-Forwarded-Proto $scheme;
+        proxy_set_header   Host              $http_host;
+        proxy_set_header   X-Real-IP         $remote_addr;
 		}
         #error_page  404              /404.html;
 

+ 3 - 3
public/index.html

@@ -42,15 +42,15 @@
   <% } %>
   <!-- 集成测试环境 -->
   <% if (process.env.VUE_APP_NODE_ENV === 'prod:sit') { %>
-    <script>window.SITE_CONFIG['apiURL'] = 'http://192.168.12.225:31903';</script>
+    <script>window.SITE_CONFIG['apiURL'] = 'http://192.168.12.225:31904';</script>
   <% } %>
   <!-- 验收测试环境 -->
   <% if (process.env.VUE_APP_NODE_ENV === 'prod:uat') { %>
-    <script>window.SITE_CONFIG['apiURL'] = 'http://192.168.12.225:31903';</script>
+    <script>window.SITE_CONFIG['apiURL'] = 'http://192.168.12.225:31904';</script>
   <% } %>
   <!-- 生产环境 -->
   <% if (process.env.VUE_APP_NODE_ENV === 'prod') { %>
-    <script>window.SITE_CONFIG['apiURL'] = 'http://192.168.12.225:31903';</script>
+    <script>window.SITE_CONFIG['apiURL'] = 'http://192.168.12.225:31904';</script>
   <% } %>
 </head>
 <body>