Skip resolving upstream services

Change-Id: I6c0851b4616e701af723ca617078e9e276e62fe6
diff --git a/devops_portal/files/nginx.conf b/devops_portal/files/nginx.conf
index fc3bcfe..25b6fcc 100644
--- a/devops_portal/files/nginx.conf
+++ b/devops_portal/files/nginx.conf
@@ -1,6 +1,7 @@
 {%- from "devops_portal/map.jinja" import config with context -%}
 {%- from "devops_portal/map.jinja" import services with context -%}
 {%- from "devops_portal/map.jinja" import service_url with context -%}
+{%- from "devops_portal/map.jinja" import service_url_dns with context -%}
 daemon off;
 
 worker_processes 1;
@@ -17,7 +18,9 @@
 
     sendfile on;
 
-    access_log /dev/stdout;
+    log_format upstreamlog '[$time_local] $remote_addr - $remote_user - $server_name to: $upstream_addr: $request upstream_response_time $upstream_response_time msec $msec request_time $request_time';
+
+    access_log  /dev/stdout upstreamlog;
 
     server {
         listen 0.0.0.0:8000 default_server;
@@ -46,12 +49,20 @@
 {%- if config.service[service_name] is defined %}
 {%- set service = config.service[service_name] %}
 {%- if service.enabled|default(True) and service.configure_proxy|default(False) %}
-
+{%- if service.resolve_hostname|default(False) %}
+        location /api/{{ service_name }}/ {
+            resolver 127.0.0.11;
+            set ${{ service.endpoint.address|replace("-", "_") }} {{ service.endpoint.address }};
+            rewrite ^/api/{{ service_name }}/(.*) /$1 break;
+            proxy_pass {{ service_url_dns(service.endpoint) }};
+        }
+{%- else %}
         location /api/{{ service_name }}/ {
             proxy_pass {{ service_url(service.endpoint) }};
         }
 {%- endif %}
 {%- endif %}
+{%- endif %}
 {%- endfor %}
     }
 }
diff --git a/devops_portal/map.jinja b/devops_portal/map.jinja
index fe144cd..d4d4219 100644
--- a/devops_portal/map.jinja
+++ b/devops_portal/map.jinja
@@ -8,6 +8,12 @@
 {{ endpoint.address }}:{{ endpoint.port }}/
 {%- endmacro %}
 
+{% macro service_url_dns(endpoint) -%}
+{%- if endpoint.get('https', False) -%}https://{%- else -%}http://{%- endif -%}
+${{ endpoint.address|replace("-", "_") }}:{{ endpoint.port }}
+{%- endmacro %}
+
+
 {% set services = [
 'artifactory',
 'elasticsearch',