nginxをリバースプロキシとして使うテストをしています。
nginx.confを下記のように書いたのですが、下記のようなエラーが出てしまいます。
locationディレクティブをどのように書けばnginxを起動できますでしょうか。
nginx.conf
1 2```user nginx; 3worker_processes 1; 4 5error_log /var/log/nginx/error.log warn; 6pid /var/run/nginx.pid; 7 8 9events { 10 worker_connections 1024; 11} 12 13 14http { 15 include /etc/nginx/mime.types; 16 default_type application/octet-stream; 17 18 log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 19 '$status $body_bytes_sent "$http_referer" ' 20 '"$http_user_agent" "$http_x_forwarded_for"'; 21 22 access_log /var/log/nginx/access.log main; 23 24 sendfile on; 25#tcp_nopush on; 26 27 keepalive_timeout 65; 28 29#gzip on; 30 31 include /etc/nginx/conf.d/*.conf; 32 location ~ \.php$ { 33 root /var/www; 34 fastcgi_pass 127.0.0.1:9000; 35 fastcgi_index index.php; 36 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 37 include fastcgi_params; 38 } 39} 40 41 42 43nginx -t 44nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) 452015/08/16 16:26:29 [warn] 10838#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:2 462015/08/16 16:26:29 [emerg] 10838#0: "location" directive is not allowed here in /etc/nginx/nginx.conf:32 47nginx: configuration file /etc/nginx/nginx.conf test failed 48
色々な回答がありましたので、現在の nginx.conf と、起動時の問題について、追記されると良いと思います。

回答3件
あなたの回答
tips
プレビュー