Added the voltha swagger interface to the proxy. Voltha's swagger
interface is now avaialble at http://localhost/swagger.
Made a small change to the way nginx is started because requests to
reload the config were comming in before it had finished loading its
config causing consul-template to choke.
Added a gitignore file in the upstreams directory to ensure that it
gets created in the repo. It needs to be there since the directory is
mounted by the container during the development phase.
Change-Id: I39a1683970ba114f5952913a5beb7cfe9cfe1cc3
diff --git a/nginx_config/includes/swagger.conf b/nginx_config/includes/swagger.conf
new file mode 100644
index 0000000..9e1669c
--- /dev/null
+++ b/nginx_config/includes/swagger.conf
@@ -0,0 +1,24 @@
+location /api/v1/local {
+ proxy_pass http://api-swagger/;
+ rewrite /api/v1/(.*) /api/v1/$1 break;
+ proxy_next_upstream error timeout invalid_header http_500;
+}
+
+location /api/v1/global {
+ proxy_pass http://api-swagger/;
+ rewrite /api/v1/(.*) /api/v1/$1 break;
+ proxy_next_upstream error timeout invalid_header http_500;
+}
+
+location /swagger {
+ proxy_pass http://api-swagger/;
+ rewrite /swagger/(.*) /$1 break;
+ sub_filter "http://localhost/" "http://localhost/swagger/";
+ sub_filter "href='" "href='swagger/";
+ sub_filter 'href="' 'href="swagger/';
+ sub_filter "src='" "src='swagger/";
+ sub_filter 'src="' 'src="swagger/';
+ sub_filter_once off;
+ proxy_next_upstream error timeout invalid_header http_500;
+}
+