title: ASP.Net 5 Code 415 Unsopported Media Type when routing over NGINX
body: <p>I have an ASP.Net 5 Application. Everthing workes fine, but when I use NGINX as reverse Proxy I have the problem that when I post something with Postman etc. I get the Error 415 unsopported Media Type. I think that NGINX removes the content-type header, but i don't know how to change that.</p>
  <p>My NGINX Configuration</p>
  <pre><code>    auth_basic &quot;#MyAuth#&quot;;
  auth_basic_user_file #MyAuthFile#;
  server_name #MyServerName#;
  location / {
      proxy_pass https://#MyServerIP:MyServerPort#/;
  
  }
  location /static/ {
      root /#MyServerDestination#/;
  }
  </code></pre>
  <p>My Controller:</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Threading.Tasks;
  using app.bauprofiler.de.Repos;
  using Bauprofiler.Models;
  using Microsoft.AspNetCore.Http;
  using Microsoft.AspNetCore.Mvc;
  using Microsoft.Extensions.Logging;
  
  namespace Bauprofiler.Controllers
  {
      [ApiController]
      [Route(&quot;api/[controller]&quot;)]
      public class ProjekteController:ControllerBase
      {
          private readonly IProjekteRepository _repo;
  
          public ProjekteController(IProjekteRepository repo)
          {
              _repo = repo;
          }
          [HttpGet]
          public IActionResult Get(){
              try
              {
                  return Ok(_repo.GetProjekte());
              }
              catch (System.Exception ex)
              {
                  Console.WriteLine(ex.Message);
                   return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
              }
          }
          [HttpGet(&quot;{id}&quot;)]
          public IActionResult Get(int id){
              try
              {
                  Projekt projekt = _repo.GetProjektById(id);
                  if(projekt == null){
                      return NotFound();
                  }
                  return Ok(projekt);
              }
              catch (System.Exception ex)
              {
                  Console.WriteLine(ex.Message);
                   return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
              }
          }
          [HttpPost]
          public IActionResult Post([FromBody] Projekt projekt){
              try
              {
                  if(!ModelState.IsValid){
                      return BadRequest(ModelState);
                  }
                  Projekt _projekt = _repo.CreateProjekt(projekt);
                  return CreatedAtAction(&quot;Get&quot;,new {id = _projekt.Id}, _projekt);
              }
              catch (System.Exception ex)
              {
                  Console.WriteLine(ex.Message);
                  return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
              }
          }
          [HttpDelete(&quot;{id}&quot;)]
          public IActionResult Delete(int id){
              try
              {
                  if(_repo.GetProjektById(id) == null){
                      return NotFound();
                  }
                  _repo.DeleteProjekt(id);
                  return NoContent();
              }
              catch (System.Exception ex)
              {
                  Console.WriteLine(ex.Message);
                   return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
              }
          }
      }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/MeyHG.png" rel="nofollow noreferrer">My Postman request</a></p>
  <p>When i remove the https:// it doesn't work.</p>