Tag: nginx

Automatically Stopping/Restarting a Phusion Passenger Docker container

The system docker container with our rails app using the passenger phusion + nginx image Systemd to manages my docker containers (restarts happen if it crashes/is stopped with docker stop myRailsApp) PROBLEM There is a spot in our code that will has a circular reference and queries active record forever. Question I’m trying to find […]

Reverse Proxy for golang docker containers

I have three docker containers, each of which has a HTTP endpoint implemented in golang. I start all three of them via a single docker-compose.yml file, like: version: ‘2’ services: first_service: build: api/firstService second_service: build: api/secondService third_service: build: api/thirdService The endpoints exposed by each of the service is unique. For example: first_service listens to /1/api; […]

Keep DNS resolution of a stopped docker container in docker DNS

I have a nginx container, which acts as proxy for other containers which sit behind the container, so nginx proxies the requests to them. I have setup the containers in a way, so that all of them have “nice” names, like “nginx.cloud” and “php.cloud”. So a request which arrrives goes from nginx.cloud to php.cloud, which […]

Accessing Site Behind nginx-proxy via IP Address

nginx-proxy docker image is used to run a reverse proxy for a wordpress site based on wordpress:latest. Question: How can I set up nginx-proxy such that I can access this wordpress site using the server’s ip address? I’m currently starting wordpress container using docker run -d \ –link mariadb:mysql \ -p 8081:80 \ -e WORDPRESS_DB_NAME=testdb […]

Artifactory docker registry docker image

I am playing around with the 4.13 version of artifactory using the pro-registry docker image I created a virtual docker repo and a local docker repo as suggested in the doc and changed the nginx conf as follows log into the running container sudo docker exec -i -t containerID# /bin/bash vi /etc/nginx/conf.d/default.conf ssl_certificate /etc/nginx/ssl/demo.pem; ssl_certificate_key […]

Docker with docker-gen variables for folders

I am using docker-gen to create an nginx docker container that acts as a proxy. However, I am having trouble with multiple websites. Using: environment: – VIRTUAL_HOST=domain.com I get it to link to both servers (containers) just fine, but I need to set the root of each server to a subfolder, otherwise both try to […]

Allow nginx to read docker.sock

In order to monitor my docker containers, I’ve decided to expose docker remote API through nginx by the following rule: server { listen 1234; server_name xxx.xxx.xxx.xxx; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://unix:/var/run/docker.sock; } } But in the nginx.error file, I get the following error: connect() to unix:/var/run/docker.sock failed […]

Random GET /nginx_status call from 127.0.0.1 inside docker container

I have a rails app running inside a docker container on passenger server. Passenger was installed using these commands: apt-get update apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv-keys 561F9B9CAC40B2F7 apt-get install -y –no-install-recommends apt-transport-https=1.0.1ubuntu2.14 ca-certificates=20160104ubuntu0.14.04.1 sh -c ‘echo deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main > /etc/apt/sources.list.d/passenger.list’ # sh -c ‘echo deb https://oss-binaries.phusionpassenger.com/apt/passenger/4 trusty main > /etc/apt/sources.list.d/passenger.list’ apt-get update apt-get […]

How to fast failover nginx upstream containers in docker (blue/green deployment)

How can I get dockerized nginx to failover quickly when one of the upstream containers goes down? Failover seems instantaneous in a non-docker environment, but several requests timeout when dockerized. I’m using nginx as a load balancer/proxy on a single node/vm in front of two instances of the same node app. I pictured new version […]

Running virtual hosts on different ports of the same container using jwilder/nginx-proxy

I’m trying to run sonatype/nexus3 behind jwilder/nginx-proxy with the idea of using it as maven and docker private repo. I’d like to get nginx proxying nexus subdomain to port 8081 of the nexus container and proxying docker subdomain to port 8082 of the same container. Is this possible? I first, I made the maven part […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.