title: How to remove header server nginx
body: <p>Using ubuntu server 20.04, nginx version: nginx/1.17.10 (Ubuntu), localhost,
  when I shut down my dot net application, &quot;502 Bad Gateway&quot; following by nginx appears ( version is hidden successfully). I did this to hide nginx:</p>
  <pre><code>sudo apt-get update -y
  sudo apt-get install -y nginx-extras
  sudo nano /etc/nginx/nginx.conf
  http {
  more_set_headers &quot;Server: Your_New_Server_Name&quot;;
  server_tokens off; }
  sudo service nginx restart
  </code></pre>
  <p><a href="https://stackoverflow.com/questions/24594971/how-to-changehide-the-nginx-server-signature/38967105#38967105">Refrence</a></p>
  <p>Even tried</p>
  <pre><code>more_clear_headers Server; 
  more_set_input_headers -r 'Server: howdy';
  </code></pre>
  <p>but still having problem. All the web suggest just the same way, but not working to me.</p>
  <p>My currently nginx.conf :</p>
  <pre><code>user ehsan1362;
  worker_processes auto;
  pid /run/nginx.pid;
  include /etc/nginx/modules-enabled/*.conf;
  events {
      worker_connections 768;
      # multi_accept on;
  }
  http {
          
      sendfile on;
      tcp_nopush on;
      tcp_nodelay on;
      keepalive_timeout 65;
      types_hash_max_size 2048;
      # server_tokens off;
      server_tokens off;
      # more_clear_headers Server;
      #more_set_input_headers -r 'Server: howdy';    
      add_header X-Frame-Options &quot;SAMEORIGIN&quot;;
  
  
  
   server_names_hash_bucket_size 64;
      # server_name_in_redirect off;
      include /etc/nginx/proxy.conf;
      include /etc/nginx/mime.types;
      default_type application/octet-stream;
      ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
      ssl_prefer_server_ciphers on;
      access_log /var/log/nginx/access.log;
      error_log /var/log/nginx/error.log;
      gzip on;
      include /etc/nginx/conf.d/*.conf;
      include /etc/nginx/sites-enabled/*;
  }
  </code></pre>