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










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







New contributor




Tyr_90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    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







    New contributor




    Tyr_90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      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







      New contributor




      Tyr_90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      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







      New contributor




      Tyr_90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Tyr_90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Tyr_90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Mar 7 at 6:26









      Tyr_90Tyr_90

      166




      166




      New contributor




      Tyr_90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Tyr_90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Tyr_90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















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



          );






          Tyr_90 is a new contributor. Be nice, and check out our Code of Conduct.









          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

          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

















          • 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












          Tyr_90 is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          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.




          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

          Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

          2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

          Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme