nginx is not working with ansible playbook2019 Community Moderator ElectionNode.js + Nginx - What now?Can multi laravel based sites be accessed by folder not by port?Share Nginx server configurationPlease help me for nginx custom log format issue with goacccessNginx grok pattern for logstashhow to get requests parameter at nginx accessHow to copy nginx logs of requests that took more than n secondsNginx erorr 404 Not Foundnginx docker compose redirect delay
How do I express some one as a black person?
Can you reject a postdoc offer after the PI has paid a large sum for flights/accommodation for your visit?
What is the magic ball of every day?
An alternative proof of an application of Hahn-Banach
Reverse string, can I make it faster?
Filtering SOQL results with optional conditionals
How to detect if C code (which needs 'extern C') is compiled in C++
Why is computing ridge regression with a Cholesky decomposition much quicker than using SVD?
How strictly should I take "Candidates must be local"?
Motivation for Zeta Function of an Algebraic Variety
Can I pump my MTB tire to max (55 psi / 380 kPa) without the tube inside bursting?
Virginia employer terminated employee and wants signing bonus returned
Word for a person who has no opinion about whether god exists
What problems would a superhuman have whose skin is constantly hot?
Why the color red for the Republican Party
NASA's RS-25 Engines shut down time
Why does Captain Marvel assume the people on this planet know this?
Reversed Sudoku
Does the nature of the Apocalypse in The Umbrella Academy change from the first to the last episode?
Counting all the hearts
Do f-stop and exposure time perfectly cancel?
If I receive an SOS signal, what is the proper response?
How can I ensure my trip to the UK will not have to be cancelled because of Brexit?
How to draw cubes in a 3 dimensional plane
nginx is not working with ansible playbook
2019 Community Moderator ElectionNode.js + Nginx - What now?Can multi laravel based sites be accessed by folder not by port?Share Nginx server configurationPlease help me for nginx custom log format issue with goacccessNginx grok pattern for logstashhow to get requests parameter at nginx accessHow to copy nginx logs of requests that took more than n secondsNginx erorr 404 Not Foundnginx docker compose redirect delay
I'm using ansible to deploy nginx-vts , prometheus, exporter and php everything works fine but nginx keeps stopping and exiting .... if i run the same images with docker compose they tun normally . the nginx image is based on alpine .
this is my playbook
- hosts: localhost
connection: local
tasks:
- name: x-vts
docker_container:
name: x-nginx
image: x:latest
state: started
volumes:
- ./php:/var/www/html/x.com
- ./site.conf:/etc/nginx/conf.d/x.com.conf:ro
ports:
- 80:80
- name: php
docker_container:
name: x-php
image: php:fpm
state: started
volumes:
- ./php:/var/www/html/x.com
- name: nginx-vts-exporter
docker_container:
name: x-Exporter
image: sophos/nginx-vts-exporter:latest
state: started
ports:
- 9913:9913
command:
- NGINX_HOST=http://nginx:80
- name: prom
docker_container:
name: x-prometheus
image: prom/prometheus:latest
state: started
ports:
- 9090:9090
volumes:
- ./monitor/prometheus.yml:/etc/prometheus/prometheus.yml
this is my nginx config file
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events
worker_connections 1024;
http
vhost_traffic_status_zone;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
log_format json_combined escape=json '"time_local":"$time_local", '
'"proxy_addr":"$remote_addr", '
'"remote_addr":"$http_x_forwarded_for", '
'"remote_user":"$remote_user", '
'"request":"$request", '
'"status":"$status", '
'"body_bytes_sent":"$body_bytes_sent", '
'"request_time":"$request_time", '
'"upstream_connect_time":"$upstream_connect_time", '
'"upstream_header_time":"$upstream_header_time", '
'"upstream_response_time":"$upstream_response_time", '
'"http_referrer":"$http_referer", '
'"http_user_agent":"$http_user_agent"';
access_log /dev/stdout json_combined;
error_log /dev/stderr info;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
include /etc/nginx/conf.d/*.conf;
server
listen 11050;
server_name nginx_vts_status
access_log off;
location /status
vhost_traffic_status_bypass_limit on;
vhost_traffic_status_bypass_stats on;
vhost_traffic_status_display;
vhost_traffic_status_display_format json;
IMPORTANT NOTE :
if i delete the line
include /etc/nginx/conf.d/*.conf;
the image launches but it does not work correctly is there anything wrong ?
docker nginx docker-compose ansible dockerfile
New contributor
add a comment |
I'm using ansible to deploy nginx-vts , prometheus, exporter and php everything works fine but nginx keeps stopping and exiting .... if i run the same images with docker compose they tun normally . the nginx image is based on alpine .
this is my playbook
- hosts: localhost
connection: local
tasks:
- name: x-vts
docker_container:
name: x-nginx
image: x:latest
state: started
volumes:
- ./php:/var/www/html/x.com
- ./site.conf:/etc/nginx/conf.d/x.com.conf:ro
ports:
- 80:80
- name: php
docker_container:
name: x-php
image: php:fpm
state: started
volumes:
- ./php:/var/www/html/x.com
- name: nginx-vts-exporter
docker_container:
name: x-Exporter
image: sophos/nginx-vts-exporter:latest
state: started
ports:
- 9913:9913
command:
- NGINX_HOST=http://nginx:80
- name: prom
docker_container:
name: x-prometheus
image: prom/prometheus:latest
state: started
ports:
- 9090:9090
volumes:
- ./monitor/prometheus.yml:/etc/prometheus/prometheus.yml
this is my nginx config file
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events
worker_connections 1024;
http
vhost_traffic_status_zone;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
log_format json_combined escape=json '"time_local":"$time_local", '
'"proxy_addr":"$remote_addr", '
'"remote_addr":"$http_x_forwarded_for", '
'"remote_user":"$remote_user", '
'"request":"$request", '
'"status":"$status", '
'"body_bytes_sent":"$body_bytes_sent", '
'"request_time":"$request_time", '
'"upstream_connect_time":"$upstream_connect_time", '
'"upstream_header_time":"$upstream_header_time", '
'"upstream_response_time":"$upstream_response_time", '
'"http_referrer":"$http_referer", '
'"http_user_agent":"$http_user_agent"';
access_log /dev/stdout json_combined;
error_log /dev/stderr info;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
include /etc/nginx/conf.d/*.conf;
server
listen 11050;
server_name nginx_vts_status
access_log off;
location /status
vhost_traffic_status_bypass_limit on;
vhost_traffic_status_bypass_stats on;
vhost_traffic_status_display;
vhost_traffic_status_display_format json;
IMPORTANT NOTE :
if i delete the line
include /etc/nginx/conf.d/*.conf;
the image launches but it does not work correctly is there anything wrong ?
docker nginx docker-compose ansible dockerfile
New contributor
add a comment |
I'm using ansible to deploy nginx-vts , prometheus, exporter and php everything works fine but nginx keeps stopping and exiting .... if i run the same images with docker compose they tun normally . the nginx image is based on alpine .
this is my playbook
- hosts: localhost
connection: local
tasks:
- name: x-vts
docker_container:
name: x-nginx
image: x:latest
state: started
volumes:
- ./php:/var/www/html/x.com
- ./site.conf:/etc/nginx/conf.d/x.com.conf:ro
ports:
- 80:80
- name: php
docker_container:
name: x-php
image: php:fpm
state: started
volumes:
- ./php:/var/www/html/x.com
- name: nginx-vts-exporter
docker_container:
name: x-Exporter
image: sophos/nginx-vts-exporter:latest
state: started
ports:
- 9913:9913
command:
- NGINX_HOST=http://nginx:80
- name: prom
docker_container:
name: x-prometheus
image: prom/prometheus:latest
state: started
ports:
- 9090:9090
volumes:
- ./monitor/prometheus.yml:/etc/prometheus/prometheus.yml
this is my nginx config file
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events
worker_connections 1024;
http
vhost_traffic_status_zone;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
log_format json_combined escape=json '"time_local":"$time_local", '
'"proxy_addr":"$remote_addr", '
'"remote_addr":"$http_x_forwarded_for", '
'"remote_user":"$remote_user", '
'"request":"$request", '
'"status":"$status", '
'"body_bytes_sent":"$body_bytes_sent", '
'"request_time":"$request_time", '
'"upstream_connect_time":"$upstream_connect_time", '
'"upstream_header_time":"$upstream_header_time", '
'"upstream_response_time":"$upstream_response_time", '
'"http_referrer":"$http_referer", '
'"http_user_agent":"$http_user_agent"';
access_log /dev/stdout json_combined;
error_log /dev/stderr info;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
include /etc/nginx/conf.d/*.conf;
server
listen 11050;
server_name nginx_vts_status
access_log off;
location /status
vhost_traffic_status_bypass_limit on;
vhost_traffic_status_bypass_stats on;
vhost_traffic_status_display;
vhost_traffic_status_display_format json;
IMPORTANT NOTE :
if i delete the line
include /etc/nginx/conf.d/*.conf;
the image launches but it does not work correctly is there anything wrong ?
docker nginx docker-compose ansible dockerfile
New contributor
I'm using ansible to deploy nginx-vts , prometheus, exporter and php everything works fine but nginx keeps stopping and exiting .... if i run the same images with docker compose they tun normally . the nginx image is based on alpine .
this is my playbook
- hosts: localhost
connection: local
tasks:
- name: x-vts
docker_container:
name: x-nginx
image: x:latest
state: started
volumes:
- ./php:/var/www/html/x.com
- ./site.conf:/etc/nginx/conf.d/x.com.conf:ro
ports:
- 80:80
- name: php
docker_container:
name: x-php
image: php:fpm
state: started
volumes:
- ./php:/var/www/html/x.com
- name: nginx-vts-exporter
docker_container:
name: x-Exporter
image: sophos/nginx-vts-exporter:latest
state: started
ports:
- 9913:9913
command:
- NGINX_HOST=http://nginx:80
- name: prom
docker_container:
name: x-prometheus
image: prom/prometheus:latest
state: started
ports:
- 9090:9090
volumes:
- ./monitor/prometheus.yml:/etc/prometheus/prometheus.yml
this is my nginx config file
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events
worker_connections 1024;
http
vhost_traffic_status_zone;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
log_format json_combined escape=json '"time_local":"$time_local", '
'"proxy_addr":"$remote_addr", '
'"remote_addr":"$http_x_forwarded_for", '
'"remote_user":"$remote_user", '
'"request":"$request", '
'"status":"$status", '
'"body_bytes_sent":"$body_bytes_sent", '
'"request_time":"$request_time", '
'"upstream_connect_time":"$upstream_connect_time", '
'"upstream_header_time":"$upstream_header_time", '
'"upstream_response_time":"$upstream_response_time", '
'"http_referrer":"$http_referer", '
'"http_user_agent":"$http_user_agent"';
access_log /dev/stdout json_combined;
error_log /dev/stderr info;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
include /etc/nginx/conf.d/*.conf;
server
listen 11050;
server_name nginx_vts_status
access_log off;
location /status
vhost_traffic_status_bypass_limit on;
vhost_traffic_status_bypass_stats on;
vhost_traffic_status_display;
vhost_traffic_status_display_format json;
IMPORTANT NOTE :
if i delete the line
include /etc/nginx/conf.d/*.conf;
the image launches but it does not work correctly is there anything wrong ?
docker nginx docker-compose ansible dockerfile
docker nginx docker-compose ansible dockerfile
New contributor
New contributor
New contributor
asked Mar 7 at 6:26
Tyr_90Tyr_90
166
166
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
It looks like you have a syntax error in your nginx configuration. You should consult to docker logs (eg: docker logs nginx) in order to see nginx stdout. It can help to show where you have syntax errors.
yes i have found the syntax problem it was with the php container name in the config file it was test-php in my playbook it was x-php now it works fine thank you
– Tyr_90
Mar 7 at 8:05
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Tyr_90 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55037346%2fnginx-is-not-working-with-ansible-playbook%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It looks like you have a syntax error in your nginx configuration. You should consult to docker logs (eg: docker logs nginx) in order to see nginx stdout. It can help to show where you have syntax errors.
yes i have found the syntax problem it was with the php container name in the config file it was test-php in my playbook it was x-php now it works fine thank you
– Tyr_90
Mar 7 at 8:05
add a comment |
It looks like you have a syntax error in your nginx configuration. You should consult to docker logs (eg: docker logs nginx) in order to see nginx stdout. It can help to show where you have syntax errors.
yes i have found the syntax problem it was with the php container name in the config file it was test-php in my playbook it was x-php now it works fine thank you
– Tyr_90
Mar 7 at 8:05
add a comment |
It looks like you have a syntax error in your nginx configuration. You should consult to docker logs (eg: docker logs nginx) in order to see nginx stdout. It can help to show where you have syntax errors.
It looks like you have a syntax error in your nginx configuration. You should consult to docker logs (eg: docker logs nginx) in order to see nginx stdout. It can help to show where you have syntax errors.
answered Mar 7 at 7:29
YarimadamYarimadam
728410
728410
yes i have found the syntax problem it was with the php container name in the config file it was test-php in my playbook it was x-php now it works fine thank you
– Tyr_90
Mar 7 at 8:05
add a comment |
yes i have found the syntax problem it was with the php container name in the config file it was test-php in my playbook it was x-php now it works fine thank you
– Tyr_90
Mar 7 at 8:05
yes i have found the syntax problem it was with the php container name in the config file it was test-php in my playbook it was x-php now it works fine thank you
– Tyr_90
Mar 7 at 8:05
yes i have found the syntax problem it was with the php container name in the config file it was test-php in my playbook it was x-php now it works fine thank you
– Tyr_90
Mar 7 at 8:05
add a comment |
Tyr_90 is a new contributor. Be nice, and check out our Code of Conduct.
Tyr_90 is a new contributor. Be nice, and check out our Code of Conduct.
Tyr_90 is a new contributor. Be nice, and check out our Code of Conduct.
Tyr_90 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55037346%2fnginx-is-not-working-with-ansible-playbook%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown