title: Why doesn't my image work on the Jelastic server?
body: <p>I created a docker image from the <code>jelastic/nginxphp:1.18.0-php-7.4.10</code> image to run my Laravel project.</p>
  <p>The image works correctly locally. But when I try to load my image from the Jeslatic server I get a 502 error when i open in browser.</p>
  <p>How can I fix this problem? (No log is produced)</p>
  <p>Dockerfile</p>
  <pre><code>FROM jelastic/nginxphp:1.18.0-php-7.4.10
  
  WORKDIR /var/www/webroot
  
  COPY server-conf/nginx/conf.d/nginx.conf /etc/nginx/nginx.conf
  
  COPY . .
  
  RUN chmod -R 777 storage
  
  RUN COMPOSER_MEMORY_LIMIT=-1 composer install --optimize-autoloader --no-interaction --no-progress --no-dev
  
  CMD service php-fpm start &amp;&amp; nginx -g &quot;daemon off;&quot;
  </code></pre>
  <p>nginx.conf</p>
  <pre><code>#user  nobody;
  worker_processes  auto;
  worker_rlimit_nofile 2048;
  
  #load_module modules/ngx_http_modsecurity_module.so;
  
  error_log  /var/log/nginx/error.log;
  #error_log  logs/error.log  notice;
  #error_log  logs/error.log  info;
  
  #pid        logs/nginx.pid;
  
  
  events {
      worker_connections  2048;
  }
  
  
  http {
      server_tokens off;
      include       mime.types;
      default_type  application/octet-stream;
      client_max_body_size 100m;
  
      log_format  main  '$remote_addr:$http_x_remote_port - $remote_user [$time_local] &quot;$request&quot; '
                        '$status $body_bytes_sent &quot;$http_referer&quot; '
                        '&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot; '
                        '&quot;$host&quot; sn=&quot;$server_name&quot; '
                        'rt=$request_time '
                        'ua=&quot;$upstream_addr&quot; us=&quot;$upstream_status&quot; '
                        'ut=&quot;$upstream_response_time&quot; ul=&quot;$upstream_response_length&quot; '
                        'cs=$upstream_cache_status' ;
  
      access_log  /var/log/nginx/access.log main;
      sendfile        on;
      keepalive_timeout  65;
  
      gzip  on;
      gzip_types text/plain text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript;
  
      server {
          listen       80 ;
          listen       [::]:80;
          server_name  _;
  
          charset utf-8;
  
          access_log  /var/log/nginx/host.access.log;
          error_log  /var/log/nginx/host.error.log;
          include /etc/nginx/aliases.conf;
  
          index index.php;
          root   /var/www/webroot/public;
  
          add_header X-Frame-Options &quot;SAMEORIGIN&quot;;
          add_header X-XSS-Protection &quot;1; mode=block&quot;;
          add_header X-Content-Type-Options &quot;nosniff&quot;;
  
  
          #modsecurity on;
          #modsecurity_rules_file /etc/nginx/conf.d/modsecurity/modsec_includes.conf;
  
          if ($http_x_remote_port = '' ) {
             set $http_x_remote_port $remote_port;
          }
  
          # enforce NO www
          if ($host ~* ^www\.(.*)) {
              set $host_without_www $1;
              rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent;
          }
          # unless the request is for a valid file (image, js, css, etc.), send to bootstrap
          if (!-e $request_filename)
          {
              rewrite ^/(.*)$ /index.php?/$1 last;
              break;
          }
  
          error_page 404 /index.php;
  
          location = /favicon.ico { access_log off; log_not_found off; }
          location = /robots.txt  { access_log off; log_not_found off; }
          #location /ws {
          #    proxy_pass http://websocket;
          #    proxy_http_version 1.1;
          #    proxy_set_header Upgrade $http_upgrade;
          #    proxy_set_header Connection &quot;Upgrade&quot;;
          #}
  
  
          # serve static files directly
          location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
              access_log off;
              expires max;
              log_not_found off;
          }
  
          location / {
              try_files $uri $uri/ /index.php?$query_string;
          }
  
          location ~ \.php$ {
              #location ~ /\. { deny all; access_log off; log_not_found off; }
              include /etc/nginx/fastcgi_params;
              fastcgi_pass unix:/var/run/php-fpm.socket;
              fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
              fastcgi_param DOCUMENT_ROOT $realpath_root;
              fastcgi_param PATH_INFO $fastcgi_script_name;
          }
  
          location ~ /\.(?!well-known).* {
                  deny all;
          }
      }
  
      include /etc/nginx/conf.d/*.conf;
  
  }
  </code></pre>
  <p>my topology
  <a href="https://i.stack.imgur.com/IGiiQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IGiiQ.png" alt="enter image description here" /></a></p>