浏览代码

Merge pull request #1258 from nightah/fix-location-proxy_pass

Utilise variable for custom locations proxy_pass
jc21 4 年之前
父节点
当前提交
66f86cf497
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      backend/templates/_location.conf

+ 2 - 1
backend/templates/_location.conf

@@ -1,10 +1,11 @@
   location {{ path }} {
+    set              $upstream {{ forward_scheme }}://{{ forward_host }}:{{ forward_port }}{{ forward_path }};
     proxy_set_header Host $host;
     proxy_set_header X-Forwarded-Scheme $scheme;
     proxy_set_header X-Forwarded-Proto  $scheme;
     proxy_set_header X-Forwarded-For    $remote_addr;
     proxy_set_header X-Real-IP		$remote_addr;
-    proxy_pass       {{ forward_scheme }}://{{ forward_host }}:{{ forward_port }}{{ forward_path }};
+    proxy_pass       $upstream;
 
     {% if access_list_id > 0 %}
     {% if access_list.items.length > 0 %}