Run api tests in pipeline

I want to try running API tests in a pipeline.
That means i need a working http server like nginx to perform tests.
I tried to solve it under services part, my gitlab-ci file looks like:

variables:
  DB_HOST: mysql
  MYSQL_USER: test
  MYSQL_PASSWORD: test
  MYSQL_DATABASE: test
  MYSQL_ROOT_PASSWORD: root

services:
  - mysql:5.7
  - nginx:latest

test:
  image:php:7.3-fpm
  script:
    - php -v
    - vendor/bin/phpunit

output of php -v works well, also all non api tests. But tests which need an http connection failing.
Anyone solved an issue like that? Have to use another apporach with docker:dind?
thanks in advance