Initial commit: VMware vSphere API simulator scaffold.
Add the FastAPI app, PostgreSQL migrations, Docker/Helm packaging, API contracts, docs, client examples, and the unit/integration/compatibility test suite for local client and tooling labs without a real vCenter.
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
# Lab gateway that exposes vCenter default HTTPS (443) and proxies to the
|
||||
# single FastAPI simulator process.
|
||||
#
|
||||
# Upstream listens on an internal-only port (simulator:8080). Host clients
|
||||
# should hit https://localhost/ — not the internal app port.
|
||||
|
||||
upstream vmware_simulator {
|
||||
server simulator:8080;
|
||||
}
|
||||
|
||||
map $server_port $vmware_service {
|
||||
default "simulator";
|
||||
80 "http";
|
||||
443 "vcenter";
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||
|
||||
location / {
|
||||
proxy_pass http://vmware_simulator;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $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-Forwarded-Port $server_port;
|
||||
proxy_set_header X-VMware-Service $vmware_service;
|
||||
proxy_set_header X-Request-ID $request_id;
|
||||
add_header X-VMware-Service $vmware_service always;
|
||||
add_header X-Forwarded-Port $server_port always;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name _;
|
||||
|
||||
ssl_certificate /etc/nginx/tls/server.crt;
|
||||
ssl_certificate_key /etc/nginx/tls/server.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
|
||||
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||
|
||||
location / {
|
||||
proxy_pass http://vmware_simulator;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $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 https;
|
||||
proxy_set_header X-Forwarded-Port 443;
|
||||
proxy_set_header X-VMware-Service vcenter;
|
||||
proxy_set_header X-Request-ID $request_id;
|
||||
add_header X-VMware-Service vcenter always;
|
||||
add_header X-Forwarded-Port 443 always;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user