Browse Source

add app host

lushuncheng 6 years ago
parent
commit
1ccbbdf211
1 changed files with 29 additions and 0 deletions
  1. 29 0
      config/nginx/conf.d/app.conf

+ 29 - 0
config/nginx/conf.d/app.conf

@@ -0,0 +1,29 @@
+# web proginn
+server {
+    listen 80;
+    server_name app.test.proginn.com;
+    set $temp_request_id $http_x_request_id;
+    if ($temp_request_id = "") {
+        set $temp_request_id $request_id;
+    }
+    set $temp_scheme $http_x_forwarded_proto;
+    if ($temp_scheme = "") {
+        set $temp_scheme $scheme;
+    }
+    set $temp_addr $http_x_forwarded_for;
+    if ($temp_addr = "") {
+        set $temp_addr $remote_addr;
+    }
+    add_header 'X-Request-Id' "$temp_request_id";
+    location / {
+        proxy_pass http://127.0.0.1/;
+        proxy_set_header Host "dev.test.proginn.com";
+        proxy_set_header X-Real-IP  $temp_addr;
+        proxy_set_header X-Forwarded-For $temp_addr;
+        proxy_set_header X-Forwarded-Proto $temp_scheme;
+        proxy_set_header X-Scheme $temp_scheme;
+        proxy_set_header Origin $http_origin;
+        proxy_set_header X-Request-Id $temp_request_id;
+        proxy_http_version 1.1;
+    }
+}