#NEWLINE# def test_config_simple_app_revproxy( self ) : #NEWLINE# #INDENT# apps = dict ( ) #NEWLINE# groups = [ 'external' ] #NEWLINE# bind_http_https = True #NEWLINE# ssl_certs = '' #NEWLINE# templater = marathon_lb . ConfigTemplater ( ) #NEWLINE# healthCheck = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# app = marathon_lb . MarathonService ( '/nginx' , 10000 , healthCheck ) #NEWLINE# app . groups = [ 'external' ] #NEWLINE# app . hostname = 'test.example.com' #NEWLINE# app . revproxypath = '/test' #NEWLINE# app . add_backend ( 'agent1' , '1.1.1.1' , 1024 , False ) #NEWLINE# apps = [ app ] #NEWLINE# config = marathon_lb . config ( apps , groups , bind_http_https , ssl_certs , templater ) #NEWLINE# expected = ( self . base_config + '\nfrontend marathon_http_in\n  bind *:80\n  mode http\n  acl host_test_example_com_nginx hdr(host) -i test.example.com\n  use_backend nginx_10000 if host_test_example_com_nginx\n\nfrontend marathon_http_appid_in\n  bind *:9091\n  mode http\n  acl app__nginx hdr(x-marathon-app-id) -i /nginx\n  use_backend nginx_10000 if app__nginx\n\nfrontend marathon_https_in\n  bind *:443 ssl crt /etc/ssl/mesosphere.com.pem\n  mode http\n  use_backend nginx_10000 if { ssl_fc_sni test.example.com }\n\nfrontend nginx_10000\n  bind *:10000\n  mode http\n  use_backend nginx_10000\n\nbackend nginx_10000\n  balance roundrobin\n  mode http\n  option forwardfor\n  http-request set-header X-Forwarded-Port %[dst_port]\n  http-request add-header X-Forwarded-Proto https if { ssl_fc }\n  acl hdr_location res.hdr(Location) -m found\n  rspirep "^Location: (https?://test.example.com(:[0-9]+)?)?(/.*)" "Location:   /test if hdr_location"\n  server agent1_1_1_1_1_1024 1.1.1.1:1024\n' ) #NEWLINE# self . assertMultiLineEqual ( config , app )