BenoitLair commented on issue #5876:
URL: https://github.com/apache/cloudstack/issues/5876#issuecomment-2085321215

   Hello Rohit,
   Is there no more anybody from citrix in ACS Dev Team ?
   I can see with Citrix asking for a Development account with freemium VPX 
versions
   It is a feature kill if we cant add vpx into ACS Mgmt server
   
   Adding Netscaler is not possible due to "Platform" label value checking with 
value "NetScaler Virtual Appliance 450000" which is now is now "Netscaler 
Remote Licensed Virtual Appliance 450000"
   
   The test should implement checking LIKE "Netscaler%%Virtual Appliance 450000"
   Also we should have choice of editing password for a Netscaler device
   
   Also there are been some minor changes when working with a VPC with External 
Load balancer of type Netscaler
   When adding some LB rules, the API calls had some little changes
   
   For working with it i installed a Nginx mounting NS ip device declared in 
ACS and forwarding request to a NS MIP ip
   
   I used lua rewrite file and subfilters in order to adapt NS API changes
   
   `
   map $http_upgrade $connection_upgrade {
   default upgrade;
   '' close;
   }
   
   upstream tunnel_ns-vpx13-ssl {
                #use MIP created on Netscaler vpx13, does work with vpx12
           server aa.bb.cc.dd:80;
           keepalive 32;
   }
   
   proxy_cache_path /var/cache/nginx-vpx13-ssl levels=1:2 
keys_zone=ns-vpx13-ssl_cache:10m max_size=3g inactive=120m use_temp_path=off;
   
   server{
   listen 443 ssl;
   server_name ee.ff.gg.hh; # use NS ip declared on ACS Mgmt server, has been 
created with vpx11 device due to constraint 'NetScaler Virtual Appliance'
   
   ssl_certificate /etc/ssl/certs/cert-selfsigned.crt;
   ssl_certificate_key /etc/ssl/private/cert-selfsigned.key;
   ssl_dhparam /etc/ssl/certs/cert-dhparam.pem;
   
   access_log      /var/log/nginx/ns-vpx13-ssl-access.log;
   error_log              /var/log/nginx/ns-vpx13-ssl-error.log;
   
      location / {
   
                access_by_lua_file /etc/nginx/vpx13-prod-ee.ff.gg.hh.lua;
   
                sub_filter_types text/html text/css text/xml application/json;
                sub_filter 'NITRO' 'NITRO2';
                sub_filter 'Login Failure' 'Login Failure22';
                sub_filter 'Netscaler Remote Licensed Virtual Appliance' 
'NetScaler Virtual Appliance';
   
                client_max_body_size 50M;
                proxy_set_header Connection "";
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header X-Frame-Options SAMEORIGIN;
                proxy_buffers 256 16k;
                proxy_buffer_size 16k;
                proxy_read_timeout 600s;
                proxy_cache ns-vpx13-ssl_cache;
                proxy_cache_revalidate on;
                proxy_cache_min_uses 2;
                proxy_cache_use_stale timeout;
                proxy_cache_lock on;
                proxy_http_version 1.1;
                proxy_pass http://tunnel_ns-vpx13-ssl;
        }
   
   }
   
   
   ## Content of /etc/nginx/vpx13-prod-ee.ff.gg.hh.lua
   
   function remove_user_key()
     ngx.req.read_body()
     -- log the original body so we can compare to the new one later
     local oldbody = ngx.req.get_body_data()
     --log(oldbody)
     -- grab the POST parameters as a table
     local params = ngx.req.get_post_args()
   
     -- build up the new JSON string
     local newbody = "{"
   
      for k,v in pairs(params) do
        -- add all the params we want to keep
        if k ~= "serviceType" then
           -- log('adding"..k.." as "..v.." :')
           newbody = newbody..'"'..k..'":"'..v..'",'
        else
           -- log("adding modified serviceType")
           newbody = newbody..'"'..k..'":"'HTTP'",'
        end
      end
     --remove the last trailing comma before closing this off
     newbody = string.sub(newbody, 0, #newbody-1)
     newbody = newbody.."}"
   
     ngx.req.set_body_data(newbody)
     -- log(newbody)
   end
   
   function format_http_vservers_protocol()
     ngx.req.read_body()
     local body = ngx.req.get_body_data()
     -- ngx.log("not adding user_key")
     ngx.log(ngx.NOTICE, "hello world")
     -- if string.find(body,"Cloud-Service-") then
           body = string.gsub(body, "TCP", "HTTP")
           ngx.req.set_body_data(body)
     -- end
   end
   
   if ngx.req.get_method() == "POST" then
     -- remove_user_key()
     -- ngx.req.read_body()
     -- local oldbody = ngx.req.get_body_data()
     -- log(oldbody)
   
     format_http_vservers_protocol()
   
     -- ngx.req.read_body()
     -- local body = ngx.req.get_body_data()
     -- if body then
     --    body = string.gsub(body, "TCP", "HTTP")
     -- end
     -- ngx.req.set_body_data(body)
   end
   
   `


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to