瀏覽代碼

修改nginx配置

Feick 5 年之前
父節點
當前提交
ea78454ec8
共有 2 個文件被更改,包括 11 次插入3 次删除
  1. 2 1
      src/main/frontend/Dockerfile
  2. 9 2
      src/main/frontend/nginx.conf

+ 2 - 1
src/main/frontend/Dockerfile

@@ -1,5 +1,6 @@
 FROM nginx:alpine
-VOLUME /usr/share/nginx/html
+VOLUME /usr/share/nginx
+RUN mkdir /usr/share/nginx/logs
 COPY static /usr/share/nginx/html
 COPY nginx.conf /etc/nginx/nginx.conf
 EXPOSE 80

+ 9 - 2
src/main/frontend/nginx.conf

@@ -13,16 +13,23 @@ http {
     keepalive_timeout  65;
     #gzip  on;
 
+    #upstream diagnosis {
+    #   server diagnosis:8080;
+    #}
+
     server {
         listen       80;
         server_name  localhost;
 
         #resolver 114.114.114.114
         charset utf-8;
-        #access_log  /usr/share/nginx/logs/host.access.log;
+        error_log /usr/share/nginx/logs/error.log;
+        access_log  /usr/share/nginx/logs/host.access.log;
 
-    	location /rest/diagnosis {
+    	location /rest/diagnosis/ {
     	    proxy_pass http://diagnosis:8080;
+    	    #proxy_set_header   Host             $host;
+    	    #proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
     	}
 
     	location / {