curl --location 'https://api.machines.dev/v1/apps' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer TOKEN' \
--data '{
"app_name": "tests",
"org_slug": "personal",
"network":"",
"enable_subdomains":true
}'
Then I create a machine for this app using
curl --location 'https://api.machines.dev/v1/apps/tests232/machines' \
--header 'Authorization: Bearer TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"config": {
"init": {
"exec": [
"/bin/sleep",
"inf"
]
},
"image": "docker-hub-mirror.fly.io",
"auto_destroy": true,
"restart": {
"policy": "always"
},
"guest": {
"cpu_kind": "shared",
"cpus": 1,
"memory_mb": 256
}
},
"services": [
{
"ports": [
{
"port": 443,
"handlers": [
"tls",
"http"
]
},
{
"port": 80,
"handlers": [
"http"
]
}
],
"protocol": "tcp",
"internal_port": 8080
}
],
"checks": {
"httpget": {
"type": "http",
"port": 8080,
"method": "GET",
"path": "/",
"interval": "15s",
"timeout": "10s"
}
}
}
}'
I now use command
fly ips allocate-v4 -a test
to allocate a public IP to the app.
I now ssh to machine and try to start my server on port 8080 and server starts.
I am unable to access the server on PORT 80 using Public IP of the app.
Can someone help me reaching my server publicly using the IP address of the app.