server {
  listen 80;
  server_name web;
  index index.php;
  error_log /logs/error.log;
  access_log /logs/access.log;
  root /code/public;

  location / {
    try_files $uri /index.php$is_args$args;
  }

  location ~ \.php {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param SCRIPT_NAME $fastcgi_script_name;
    fastcgi_index index.php;
    fastcgi_read_timeout 3600;
    fastcgi_pass web:9000;
  }
}
server {
  listen 443;
  listen [::]:443;

  index index.php;

  error_log /logs/error.log;
  access_log /logs/access.log;

  root /code/public;

  location / {
    try_files $uri $uri/ /index.php$is_args$args;
  }

  location ~ \.php$ {
    try_files $uri $uri/ =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param SCRIPT_NAME $fastcgi_script_name;
    fastcgi_index index.php;
    fastcgi_read_timeout 3600;
    fastcgi_pass web:9000;
  }
}
