Fork me on GitHub

Nginx配置Q&A

隐藏响应头

How can remove Nginx from http response header? - Stack Overflow

more_set_headers 'Server: my-server';
more_clear_headers 'Server';

http 到 https

  if ($scheme = http) {
        return 301 https://$server_name$request_uri;
    }

隐藏fastcgi响应头

fastcgi_hide_header X-Powered-By;

隐藏nginx版本

server_tokens off;

添加额外响应头

add_header X-Frame-Options SAMEORIGIN;
posted @ 2016-02-29 10:24  weaming  阅读(327)  评论(0编辑  收藏  举报
 |  Github |  知乎 |  微博  |