nginx is not working with ansible playbookNode.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 to explain what's wrong with this application of the chain rule?

Non-trope happy ending?

How should I respond when I lied about my education and the company finds out through background check?

Does malloc reserve more space while allocating memory?

Can a College of Swords bard use a Blade Flourish option on an opportunity attack provoked by their own Dissonant Whispers spell?

15% tax on $7.5k earnings. Is that right?

Does the Linux kernel need a file system to run?

What does "Scientists rise up against statistical significance" mean? (Comment in Nature)

How to hide some fields of struct in C?

Yosemite Fire Rings - What to Expect?

Recommended PCB layout understanding - ADM2572 datasheet

Is there a way to get `mathscr' with lower case letters in pdfLaTeX?

Does IPv6 have similar concept of network mask?

Can disgust be a key component of horror?

How does the math work for Perception checks?

Creepy dinosaur pc game identification

What are some good ways to treat frozen vegetables such that they behave like fresh vegetables when stir frying them?

Open a doc from terminal, but not by its name

How can "mimic phobia" be cured or prevented?

Are Captain Marvel's powers affected by Thanos' actions in Infinity War

Pre-mixing cryogenic fuels and using only one fuel tank

Strong empirical falsification of quantum mechanics based on vacuum energy density

When were female captains banned from Starfleet?

What exact color does ozone gas have?



nginx is not working with ansible playbook


Node.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













0















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 ?










share|improve this question


























    0















    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 ?










    share|improve this question
























      0












      0








      0








      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 ?










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 7 at 6:26









      Tyr_90Tyr_90

      166




      166






















          1 Answer
          1






          active

          oldest

          votes


















          0














          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.






          share|improve this answer























          • 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










          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
          );



          );













          draft saved

          draft discarded


















          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









          0














          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.






          share|improve this answer























          • 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















          0














          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.






          share|improve this answer























          • 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













          0












          0








          0







          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.






          share|improve this answer













          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 7 at 7:29









          YarimadamYarimadam

          753411




          753411












          • 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





          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



















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          1928 у кіно

          Захаров Федір Захарович

          Ель Греко