title: ASP .NET Core - Linux nginx ASPNETCORE_ENVIROMENT Error
body: <p>I am trying to figure out this bug for a week but I still cant find the error.</p>
  
  <p>System I am currently running is Linux Ubuntu 16.04</p>
  
  <p>I have set everything to production in launchSettings.json</p>
  
  <pre><code>{
    "iisSettings": {
      "windowsAuthentication": false,
      "anonymousAuthentication": true,
      "iisExpress": {
        "applicationUrl": "http://localhost:51754/",
        "sslPort": 0
      }
    },
    "profiles": {
      "IIS Express": {
        "commandName": "IISExpress",
        "launchBrowser": true,
        "environmentVariables": {
          "ASPNETCORE_ENVIRONMENT": "Production"
        }
      },
      "FilmerCore": {
        "commandName": "Project",
        "launchBrowser": true,
        "environmentVariables": {
          "ASPNETCORE_ENVIRONMENT": "Production"
        },
        "applicationUrl": "http://localhost:51755"
      }
    }
  }
  </code></pre>
  
  <p>And this is my web.config </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;system.webServer&gt;
      &lt;handlers&gt;
        &lt;add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /&gt;
      &lt;/handlers&gt;
      &lt;aspNetCore processPath="dotnet" arguments=".\FilmerCore.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout"&gt;
      &lt;environmentVariables&gt;
          &lt;environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Production" /&gt;
        &lt;/environmentVariables&gt;
      &lt;/aspNetCore&gt;
    &lt;/system.webServer&gt;
  
  &lt;/configuration&gt;
  &lt;!--ProjectGuid: 5be3ea4c-66c2-42b0-8583-29c6bf415674--&gt;
  </code></pre>
  
  <p>Aslo I am using nginx as a reverse proxy. The main config is this</p>
  
  <pre><code>[Unit]
      Description=Filmer - .NET movie platform
  
      [Service]
      WorkingDirectory=/var/aspnetcore/filmer
      ExecStart=/usr/bin/dotnet /var/aspnetcore/filmer/FilmerCore.dll
      Restart=always
      RestartSec=10                                          # Restart service after 10 seconds if dotnet service crashes
      SyslogIdentifier=filmer
      User=www-data
      Environment=ASPNETCORE_ENVIRONMENT=Development 
  
      [Install]
      WantedBy=multi-user.target
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/SX0bW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SX0bW.png" alt="Error that is showing up"></a></p>