環境
- CentOS7
 - Nginx
 
robots.txt ファイルの作成
- 任意のURLをGoogle検索などに引っかからないようにしたい
 - その他詳細な指定などは割愛
 
$ cd /var/www
$ vi robots.txt
User-Agent: *
Disallow: /
xxx.conf
$ cd /etc/nginx/conf.d/
$ vi xxx.conf
server {
	listen       80;
	server_name  sample.com;
	root   /path/to/your/project/public;
	index  index.html index.htm;
	# sample.com/robots.txt にアクセスした時に /var/www/robots.txt を表示させる
	location /robots.txt {
		alias /var/www/robots.txt;
	}
}
# syntaxチェック
$ nginx -t
# 再起動
$ systemctl restart nginx.service