Dokku use subdomain as global - dokku

I'm trying to use Dokku on my own VPS and deploy my apps on subdomains of my third-level root domain.
For example if my Dokku global vhost is server.domain.tld, I want to have my app to be deployed to my-app.server.domain.tld.
For the moment I did the following:
$ dokku domains:add-global server.domain.tld
$ dokku domains:set-global server.domain.tld
And then deployed my app:
$ git remote add dokku dokku#server.domain.tld:my-app
$ git push dokku master
remote: =====> Application deployed:
remote: http://my-app.server.domain.tld
But when I go to http://my-app.server.domain.tld the server doesn't respond, I have to browse http://server.domain.tld to see my app.
$ dokku domains:report
=====> my-app domains information
Domains app enabled: true
Domains app vhosts: my-app.server.domain.tld
Domains global enabled: true
Domains global vhosts: server.domain.tld
Does Dokku support subdomains as global domain?
Do I have to use a specific config?

After digging into Dokku GitHub issues, I found:
Are nested subdomains supported in Dokku? #394
Cannot access app by domain name #2574
You need to add a wildcard DNS record (*.server.domain.tld)
Dokku DNS documentation with more infos

Related

Set up nginx to route subdomains to specific ports in home server (e.g. for Nextcloud)

I have a home server.
Local IP: 192.168.0.6
And assume public IP: 1.2.3.4
On the server I have Docker and NGINX installed.
Let's say that I also own a domain: mydomain.com.
I would like to have local and remote access to my Nextcloud Web UI using following subdomain: nextcloud.mydomain.com as Nextcloud requires an actual domain for initial setup.
This subdomain (nextcloud.mydomain.com) currently has it's A record set to 1.2.3.4 (my public IP). Is it correct approach or should I go with a different approach such as CNAME records for the main domain (mydomain.com)? Not sure on this one.
My general question is how can I configure NGINX in a way that it will point nextcloud.mydomain.com to my Nextcloud container instance.
I was able to access Nextcloud Web UI locally through 192.168.0.6:8443 so I assume that this is the port that NGINX should route to from the subdomain.
My Nextcloud instance exists as a docker container set up with default attributes:
--publish 80:80 \
--publish 8080:8080 \
--publish 8443:8443 \
I haven't configured NGINX yet at all to not mess anything.
I would be grateful for any explanation what steps I should take and if my understanding of the entire concept is correct.

Node js Application running on EC2 but not accessible in browser using Nginx

I'm a newbie to Nginx. I cannot access my Node.js application that I deploy on AWS EC2 using Nginx reverse proxy. If I do curl http://localhost:3000 I can see the application is running successfully on the server(I'm using pm2 for running node server). But when I try to access it in my browser or postman using public DNS I get the error This site can't be reached and the request gets timeout. Here's my Nginx configuration (I have followed a number of tutorials for this)
The configuration file is named nginx.conf and is in /etc/nginx/sites-enabled directory. If I do sudo nginx -t it says syntax is ok and the test is successful. Also I can see the Nginx is running using command sudo systemctl status nginx What could be the possible reason for this behaviour?
I figured it out the problem wasn't with the Nginx configuration actually I needed to allow public access for port 80 on my ec2 instance which is blocked by default. I allowed port 80 and everything is working fine. This blog helped me. Visit it for me details on how to enable port 80 for your ec2 instance.

Ignore https gcloud composer airflow

I am running a gcloud composer command from behind a proxy how do I set it to ignore https.
gcloud composer environments run $project --location $location list_dags
Unable to connect to the server: x509: cannot validate certificate for X.X.X.X because it doesn't contain any IP SANs
Up to current versions of Cloud Composer (1.9.0 at the time of writing), the gcloud composer environments run command works by connecting to the Kubernetes master of your environment's GKE cluster. The error means there is something is potentially wrong with the configuration given to you by the GKE API, or there is something intercepting your traffic (like a non-transparent proxy on a corporate network). You should verify that you can connect to the Kubernetes master using kubectl and resolve any issues with that before trying to use the Composer command.
To connect using kubectl, obtain cluster credentials and then try issuing a few commands:
gcloud container clusters get-credentials --zone=$Z $COMPOSER_CLUSTER_NAME
kubectl get pods
To answer your question directly, you can use --insecure-skip-tls-verify can fix your issue if you use kubectl, but this option cannot be passed to gcloud composer.

Firebase serve from vagrant localhost:5000

I'm running vagrant/ubuntu 16.04 on mac os high sierra. I have set port forwarding and symlink to awesome.local.com. Basic node.js web app works perfectly and can be viewed on mac chrome browser pointing to awesome.local.com:3000
I want to develop firebase in this environment the same way, and was able to set-up the CLI and logged in fine.
Going through the Firebase Web Codelab: https://codelabs.developers.google.com/codelabs/firebase-web/index.html?index=..%2F..%2Findex#0
When running
$ firebase serve
Looks like everything is running without error (I did debug):
hosting: Local server: http://localhost:5000
When I go to the browser and point to awesome.local.com:5000 I get:
This site can’t be reached
awesome.locl.com refused to connect.
Search Google for awesome.local.com:5000
ERR_CONNECTION_REFUSED
I've tried:
rebuilt dev environment
reinstalling everything
other tutorials
Thanks for any help with this.
If you want to run firebase serve against a different host and port, see the help in the CLI:
$ firebase serve --help
Usage: serve [options]
start a local server for your static assets
Options:
-p, --port <port> the port on which to listen (default: 5000) (default: 5000)
-o, --host <host> the host on which to listen (default: localhost) (default: localhost)
--only <targets> only serve specified targets (valid targets are: functions, hosting)
--except <targets> serve all except specified targets (valid targets are: functions, hosting)
-h, --help output usage information
You can change the host and port it listens to with -p and -o. The default will only bind to localhost, which will not be accessible to anything other than 127.0.0.1.

firebase cli serve cant access the project from different device

I have install firebase cli etcetc. I can start the project and develop using firebase serve. I can visit the page of the project through localhost:5000 but if i try from different device in my network (mobile phone) to access network-ip:5000 I get connection refused.
Anyone knows what configuration/command it needs to forward port 5000 ? (different projects like creat-react-app works fine)
firebase serve -o 0.0.0.0
The -o flag sets the host.
For more information, see Server Fault: What's the difference between IP address 0.0.0.0 and 127.0.0.1?
With a local IP 192.168.0.10
I launched firebase serve -o 192.168.0.10 and it works perfectly on port 5000 from other device
In my javascript app :
functions.useFunctionsEmulator('http://192.168.0.10:5000')
If you run firebase serve --help, it will give you the information needed to listen on a different port or IP address:
Usage: serve [options]
start a local server for your static assets
Options:
-p, --port <port> the port on which to listen (default: 5000) (default: 5000)
-o, --host <host> the host on which to listen (default: localhost) (default: localhost)
--only <targets> only serve specified targets (valid targets are: functions, hosting)
--except <targets> serve all except specified targets (valid targets are: functions, hosting)
-h, --help output usage information
You can use -p and -o on the command line to change the host and port where it listens for connections. For your case, you won't be able use localhost for the host because that's only visible to other processes on the same machine.
This worked for me. I found the config.json file for the functions-emulator (It's in user/.config/configstore/#googlecloud/functions-emulator/config.json on mac or windows) and changed "bindHost": "localhost", to "bindHost": "0.0.0.0" and then I could access served functions from other devices on my network via localip:5000 which wasn't working before.
Tivoli commented on Aug 20, 2017 •
Digging around the code I figured this out, it's because the
firebase-tools is only setting the projectId as part of the
functions-emulator config. This fixes it in my Dockerfile
ADD config.json
/root/.config/configstore/#google-cloud/functions-emulator/config.json
and the config.json looks like this
{
"bindHost": "0.0.0.0" }
You can change the 0.0.0.0 to any host you want, but this works for
Docker.
For reference
https://github.com/firebase/firebase-tools/blob/master/lib/serve/functions.js#L71
is the offending block, it needs to set the above parameter to the
same as the --host command line parameter.
If you are running on your own local machine then you need to set it
to the configstore folder for your respective OS on OS X it would be
~/.config/configstore/#google-cloud/functions-emulator/config.json.
Reference for the default config values
https://github.com/GoogleCloudPlatform/cloud-functions-emulator/blob/master/src/defaults.json

Resources