# Differences between Apache and Nginx (From Brasil)

**URL:** <https://discourse.slimframework.com/t/differences-between-apache-and-nginx-from-brasil/5984>\
**Category:** Questions\
**Created:** [September 11, 2024, 10:57pm UTC](https://discourse.slimframework.com/t/differences-between-apache-and-nginx-from-brasil/5984 "2024-09-11T22:57:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinibarr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/vinibarr/32/1559_2.png) [@vinibarr](https://discourse.slimframework.com/u/vinibarr)\
**Post date:** [September 11, 2024, 10:57pm UTC](https://discourse.slimframework.com/t/differences-between-apache-and-nginx-from-brasil/5984/1 "2024-09-11T22:57:55Z")

</div>

Hi guys;

I´m using a basic slim api V4; in apache server, i can read header, BUT in Nginx, i can´t; what i have to do to work in Nginx, please?

$app = AppFactory::create();  
$app-\>addBodyParsingMiddleware();  
$errorMiddleware = $app-\>addErrorMiddleware(true, true, true);  
$app-\>get($rootRoute . ‘v1/smallroomlist/’, RoomList::class . ‘:getSmallRoomList’);

In RoomList controller:

```
public function getSmallRoomList(Request $request, Response $response, array $args): Response
{
    var_dump($_SERVER); << goes empty in Ngnix, but full in Apache
    
    $token = '';
    $headers = $request->getHeaders(); <- always empty in Nginx...

    foreach ($headers as $name => $values) {
        if ($name == 'X-Auth-IApi-Token') {
            $token = $values[0]; 
        }
        if ($name == 'X-AUTH-IAPI-TOKEN') {
            $token = $values[0];
        }            
    }

```

I read about headers in slim webiste, but in Nginx, headers allways be empty,.

Tanks;

---

<div class="post-metadata">

**Author:** ![vinibarr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/vinibarr/32/1559_2.png) [@vinibarr](https://discourse.slimframework.com/u/vinibarr)\
**Post date:** [September 12, 2024, 1:58pm UTC](https://discourse.slimframework.com/t/differences-between-apache-and-nginx-from-brasil/5984/2 "2024-09-12T13:58:10Z")

</div>

Problem solved; Nginx configurations were blocking the API. Only the autoloading of classes still doesn’t work on Nginx despite working on Apache.

---

<div class="post-metadata">

**Author:** ![aaronfc](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/aaronfc/32/1650_2.png) [@aaronfc](https://discourse.slimframework.com/u/aaronfc)\
**Post date:** [September 15, 2024, 10:44am UTC](https://discourse.slimframework.com/t/differences-between-apache-and-nginx-from-brasil/5984/3 "2024-09-15T10:44:26Z")

</div>

Can you share what configurations were generating the issue and how did you solve it? For posterity
